================
@@ -503,6 +503,10 @@ bool Scanner::lexModuleDirectiveBody(DirectiveKind Kind,
const char *&First,
diag::err_dep_source_scanner_missing_semi_after_at_import);
if (Tok.is(tok::semi))
break;
+ if (Tok.is(tok::hash) || Tok.is(tok::at))
+ return reportError(
----------------
akyrtzi wrote:
I think this should work fine for the test case:
```
@@ -496,7 +496,12 @@ bool Scanner::lexModuleDirectiveBody(DirectiveKind Kind,
const char *&First,
const char *const End) {
const char *DirectiveLoc = Input.data() + CurDirToks.front().Offset;
for (;;) {
+ const char *PriorFirst = First;
const dependency_directives_scan::Token &Tok = lexToken(First, End);
+ if (Tok.is(tok::hash) && Tok.Flags & clang::Token::StartOfLine) {
+ First = PriorFirst;
+ return false;
+ }
if (Tok.is(tok::eof))
return reportError(
DirectiveLoc,
```
https://github.com/llvm/llvm-project/pull/142452
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits