| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify -Wduplicate-decl-specifier %s |
| 2 |
// RUN: %clang_cc1 -fsyntax-only -verify -Wc++-compat %s |
| 3 |
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-duplicate-decl-specifier -Wc++-compat %s |
| 4 |
// RUN: %clang_cc1 -fsyntax-only -verify=good -Wc++-compat -Wno-duplicate-decl-specifier %s |
| 5 |
// RUN: %clang_cc1 -fsyntax-only -verify=good -Wno-duplicate-decl-specifier %s |
| 6 |
// RUN: %clang_cc1 -fsyntax-only -verify -x c++ %s |
| 7 |
// good-no-diagnostics |
| 8 |
|
| 9 |
// Note: we treat this as a warning in C++, so you get the same diagnostics in |
| 10 |
// either language mode. However, GCC diagnoses this as an error, so the |
| 11 |
// compatibility warning has value. |
| 12 |
const 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}} |
| 16 |
int j = 12; |
| 17 |
|
| 18 |
volatile const volatile const int x = 1; // expected-warning {{duplicate 'const' declaration specifier}} \ |
| 19 |
expected-warning {{duplicate 'volatile' declaration specifier}} |