because there is no way to fully qualify the enumerator name, so this
"extension" was unintentional and useless. This fixes
`Issue 42372 <https://github.com/llvm/llvm-project/issues/42372>`_.
+- Now correctly diagnose use of ``//`` comments in ``gnu89`` mode (which
+ matches the behavior of GCC) in addition to ``c89`` mode. This fixes
+ `Issue 18427 <https://github.com/llvm/llvm-project/issues/18427>`_.
Improvements to Clang's diagnostics
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LANGSTANDARD(gnu89, "gnu89",
C, "ISO C 1990 with GNU extensions",
- LineComment | Digraphs | GNUMode)
+ Digraphs | GNUMode)
LANGSTANDARD_ALIAS(gnu89, "gnu90")
// C99-ish modes
/* RUN: %clang_cc1 -std=c90 -fsyntax-only %s -verify -pedantic-errors
*/
+/* RUN: %clang_cc1 -std=gnu89 -fsyntax-only %s -verify -pedantic-errors
+ */
enum { cast_hex = (long) (
0x0p-1 /* expected-error {{hexadecimal floating constants are a C99 feature}} */
-// RUN: %clang_cc1 %s -std=gnu89 -pedantic -fsyntax-only -verify
+/* RUN: %clang_cc1 %s -std=gnu89 -pedantic -fsyntax-only -verify
+ */
int f(int restrict);
-void main(void) {} // expected-warning {{return type of 'main' is not 'int'}} expected-note {{change return type to 'int'}}
+void main(void) {} /* expected-warning {{return type of 'main' is not 'int'}} expected-note {{change return type to 'int'}} */