File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,12 @@ class BuilderClosureVisitor
163
163
if (isa<IfConfigDecl>(decl))
164
164
continue ;
165
165
166
+ // Emit #warning/#error but don't build anything for it.
167
+ if (auto poundDiag = dyn_cast<PoundDiagnosticDecl>(decl)) {
168
+ TypeChecker::typeCheckDecl (poundDiag);
169
+ continue ;
170
+ }
171
+
166
172
if (!unhandledNode)
167
173
unhandledNode = decl;
168
174
Original file line number Diff line number Diff line change @@ -225,3 +225,12 @@ func extraArg() {
225
225
6 // expected-error {{extra argument in call}}
226
226
}
227
227
}
228
+
229
+ // rdar://problem/53209000 - use of #warning and #error
230
+ tuplify ( true ) { x in
231
+ 1
232
+ #error("boom") // expected-error{{boom}}
233
+ " hello "
234
+ #warning("oops") // expected-warning{{oops}}
235
+ 3.14159
236
+ }
You can’t perform that action at this time.
0 commit comments