forked from OSchip/llvm-project
[modules] Accept //-style comments in module maps on purpose rather than by
accident, and accept them even when they begin '//*'. llvm-svn: 229240
This commit is contained in:
parent
0bbcd8ba2f
commit
0414b8578e
|
@ -89,7 +89,9 @@ ModuleMap::ModuleMap(SourceManager &SourceMgr, DiagnosticsEngine &Diags,
|
|||
HeaderSearch &HeaderInfo)
|
||||
: SourceMgr(SourceMgr), Diags(Diags), LangOpts(LangOpts), Target(Target),
|
||||
HeaderInfo(HeaderInfo), BuiltinIncludeDir(nullptr),
|
||||
CompilingModule(nullptr), SourceModule(nullptr) {}
|
||||
CompilingModule(nullptr), SourceModule(nullptr) {
|
||||
MMapLangOpts.LineComment = true;
|
||||
}
|
||||
|
||||
ModuleMap::~ModuleMap() {
|
||||
for (llvm::StringMap<Module *>::iterator I = Modules.begin(),
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fmodule-map-file=%s -fsyntax-only -x c++ /dev/null 2>&1
|
||||
//
|
||||
// RUN: cp %s %t-duplicate.modulemap
|
||||
// RUN: not %clang_cc1 -fmodules -fmodules-cache-path=%t -fmodule-map-file=%s -fmodule-map-file=%t-duplicate.modulemap -fsyntax-only -x c++ /dev/null 2>&1 | FileCheck --check-prefix=CHECK-DUPLICATE %s
|
||||
|
||||
|
@ -6,3 +8,5 @@
|
|||
// CHECK-DUPLICATE: duplicate.modulemap:[[@LINE+2]]:8: error: redefinition of module 'foo'
|
||||
// CHECK-DUPLICATE: diagnostics.modulemap:[[@LINE+1]]:8: note: previously defined here
|
||||
module foo {}
|
||||
|
||||
//* Check that we accept BCPL comments properly, not just as an extension. */
|
||||
|
|
Loading…
Reference in New Issue