You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[C] Diagnose use of C++ keywords in C (llvm#137234)
This adds a new diagnostic group, -Wc++-keyword, which is off by default
and grouped under -Wc++-compat. The diagnostic catches use of C++
keywords in C code.
This change additionally fixes an issue with -Wreserved-identifier not
diagnosing use of reserved identifiers in function parameter lists in a
function declaration which is not a definition.
Fixesllvm#21898
Copy file name to clipboardExpand all lines: clang/test/OpenMP/assumes_messages.c
+8-2Lines changed: 8 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -59,8 +59,14 @@
59
59
#pragma omp begin assumes ext // expected-warning {{valid begin assumes clauses start with 'ext_', 'absent', 'contains', 'holds', 'no_openmp', 'no_openmp_routines', 'no_openmp_constructs', 'no_parallelism'; token will be ignored}}
60
60
#pragma omp end assumes
61
61
62
-
#pragma omp assumes ext_123(not allowed) // expected-warning {{'ext_123' clause should not be followed by arguments; tokens will be ignored}} expected-note {{the ignored tokens spans until here}}
63
-
#pragma omp begin assumes ext_123(not allowed) // expected-warning {{'ext_123' clause should not be followed by arguments; tokens will be ignored}} expected-note {{the ignored tokens spans until here}}
62
+
// FIXME: We should be getting an expected note about where the span of ignored
63
+
// tokens ends. However, error recovery ends up lexing the 'not' token,
64
+
// emitting a (silenced) diagnostic about use of a C++ keyword in C, and the
65
+
// note gets associated with *that* (silenced) diagnostic. This is an existing
66
+
// issue that also happens with error recovery of reserved identifiers or
67
+
// extension tokens, but is unfortunate nonetheless.
68
+
#pragma omp assumes ext_123(not allowed) // expected-warning {{'ext_123' clause should not be followed by arguments; tokens will be ignored}}
69
+
#pragma omp begin assumes ext_123(not allowed) // expected-warning {{'ext_123' clause should not be followed by arguments; tokens will be ignored}}
64
70
#pragma omp end assumes
65
71
66
72
#pragma omp end assumes // expected-error {{'#pragma omp end assumes' with no matching '#pragma omp begin assumes'}}
0 commit comments