Skip to content

Commit a42c5ce

Browse files
Add no-op visitor in SILGenFunction for #warning/#error (swiftlang#15008)
* Add no-op visitor in SILGenFunction for #warning/#error * Switch to a compile-based test * Actually add file substitution
1 parent be4c2b9 commit a42c5ce

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/SILGen/SILGenFunction.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,6 +1682,10 @@ class LLVM_LIBRARY_VISIBILITY SILGenFunction
16821682
// No lowering support needed.
16831683
}
16841684

1685+
void visitPoundDiagnosticDecl(PoundDiagnosticDecl *D) {
1686+
// No lowering support needed.
1687+
}
1688+
16851689
void visitVarDecl(VarDecl *D);
16861690

16871691
/// Emit an Initialization for a 'var' or 'let' decl in a pattern.

test/Sema/pound_diagnostics.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %target-typecheck-verify-swift
2+
// RUN: %target-swift-frontend -c -verify %s -o /dev/null
23

34
#warning("this should be a warning") // expected-warning {{this should be a warning}}
45
#error("this should be an error") // expected-error {{this should be an error}}

0 commit comments

Comments
 (0)