brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 8366f77 Raw
20 lines · c
1// RUN: %clang_cc1 -fsyntax-only -verify -Wduplicate-decl-specifier %s2// RUN: %clang_cc1 -fsyntax-only -verify -Wc++-compat %s3// RUN: %clang_cc1 -fsyntax-only -verify -Wno-duplicate-decl-specifier -Wc++-compat %s4// RUN: %clang_cc1 -fsyntax-only -verify=good -Wc++-compat -Wno-duplicate-decl-specifier %s5// RUN: %clang_cc1 -fsyntax-only -verify=good -Wno-duplicate-decl-specifier %s6// RUN: %clang_cc1 -fsyntax-only -verify -x c++ %s7// good-no-diagnostics8 9// Note: we treat this as a warning in C++, so you get the same diagnostics in10// either language mode. However, GCC diagnoses this as an error, so the11// compatibility warning has value.12const const int i = 12; // expected-warning {{duplicate 'const' declaration specifier}}13 14__attribute__((address_space(1)))15__attribute__((address_space(1))) // expected-warning {{multiple identical address spaces specified for type}}16int j = 12;17 18volatile const volatile const int x = 1; // expected-warning {{duplicate 'const' declaration specifier}} \19                                            expected-warning {{duplicate 'volatile' declaration specifier}}20