Skip to content

Commit f04c817

Browse files
committed
Downgrade conditional compilation assignment error to a warning
To unblock certain projects that are using malformed flags, downgrade this specific error to a warning for now. rdar://33018039
1 parent 7c111b6 commit f04c817

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

include/swift/AST/DiagnosticsFrontend.def

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ ERROR(invalid_conditional_compilation_flag,none,
187187
"conditional compilation flags must be valid Swift identifiers (rather than '%0')",
188188
(StringRef))
189189

190-
ERROR(cannot_assign_value_to_conditional_compilation_flag,none,
191-
"conditional compilation flags do not have values in Swift; they are either present or absent"
192-
" (rather than '%0')", (StringRef))
190+
WARNING(cannot_assign_value_to_conditional_compilation_flag,none,
191+
"conditional compilation flags do not have values in Swift; they are "
192+
"either present or absent (rather than '%0')", (StringRef))
193193

194194
#ifndef DIAG_NO_UNDEF
195195
# if defined(DIAG)

test/Frontend/unknown-arguments.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99

1010
// RUN: not %swiftc_driver -D Correct -DAlsoCorrect -D@#%! -D Swift=Cool -D-D -c %s -o %t.o 2>&1 | %FileCheck -check-prefix=INVALID-COND %s
1111
// INVALID-COND: <unknown>:0: error: conditional compilation flags must be valid Swift identifiers (rather than '@#%!')
12-
// INVALID-COND-NEXT: <unknown>:0: error: conditional compilation flags do not have values in Swift; they are either present or absent (rather than 'Swift=Cool')
12+
// INVALID-COND-NEXT: <unknown>:0: warning: conditional compilation flags do not have values in Swift; they are either present or absent (rather than 'Swift=Cool')
1313
// INVALID-COND-NEXT: <unknown>:0: error: conditional compilation flags must be valid Swift identifiers (rather than '-D')
1414

0 commit comments

Comments
 (0)