Erik Pilkington | 6f11db1 | 2018-09-28 20:24:58 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -Weverything -xc++ -std=c++11 -DCXX11 -verify %s |
| 2 | // RUN: %clang_cc1 -Weverything -xc++ -std=c++03 -DCXX03 -verify %s |
| 3 | // RUN: %clang_cc1 -Weverything -xobjective-c -DOBJC -verify %s |
| 4 | // RUN: %clang_cc1 -Weverything -std=c11 -xc -DC11 -verify %s |
| 5 | // RUN: %clang_cc1 -Weverything -std=c11 -xc -fms-extensions -DMS -verify %s |
| 6 | |
| 7 | enum X : int {e}; |
| 8 | #if defined(CXX11) |
| 9 | // expected-warning@-2{{enumeration types with a fixed underlying type are incompatible with C++98}} |
| 10 | #elif defined(CXX03) |
| 11 | // expected-warning@-4{{enumeration types with a fixed underlying type are a C++11 extension}} |
| 12 | #elif defined(OBJC) |
| 13 | // expected-no-diagnostics |
| 14 | #elif defined(C11) |
| 15 | // expected-warning@-8{{enumeration types with a fixed underlying type are a Clang extension}} |
| 16 | #elif defined(MS) |
| 17 | // expected-warning@-10{{enumeration types with a fixed underlying type are a Microsoft extension}} |
| 18 | #endif |