File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change 17
17
#include " swift/Parse/Parser.h"
18
18
19
19
#include " swift/AST/ASTVisitor.h"
20
+ #include " swift/AST/DiagnosticSuppression.h"
20
21
#include " swift/Basic/Defer.h"
21
22
#include " swift/Basic/LangOptions.h"
22
23
#include " swift/Basic/Version.h"
@@ -641,6 +642,7 @@ ParserResult<IfConfigDecl> Parser::parseIfConfig(
641
642
} else if (SyntaxContext->isEnabled ()) {
642
643
// We shouldn't skip code if we are building syntax tree.
643
644
// The parser will keep running and we just discard the AST part.
645
+ DiagnosticSuppression suppression (Context.Diags );
644
646
SmallVector<ASTNode, 16 > dropedElements;
645
647
parseElements (dropedElements, false );
646
648
} else {
Original file line number Diff line number Diff line change @@ -22,4 +22,7 @@ class { // expected-error {{unknown declaration syntax exists in the source}}
22
22
23
23
#if swift(<1)
24
24
print ( " Wat " )
25
+ class { // expected-error {{unknown declaration syntax exists in the source}}
26
+
27
+ }
25
28
#endif
You can’t perform that action at this time.
0 commit comments