2020-05-11 04:39:23 +08:00
|
|
|
// RUN: %clang_cc1 -verify -std=c++98 %s
|
2020-05-11 04:58:42 +08:00
|
|
|
// RUN: %clang_cc1 -verify=cxx11 -std=c++11 %s
|
|
|
|
|
|
|
|
#if __cplusplus < 201103L
|
2020-05-11 04:39:23 +08:00
|
|
|
// expected-no-diagnostics
|
2020-05-11 04:58:42 +08:00
|
|
|
#endif
|
2020-05-11 04:39:23 +08:00
|
|
|
|
|
|
|
// Objective-C allows C++11 enumerations in C++98 mode. We disambiguate in
|
|
|
|
// order to make this a backwards-compatible extension.
|
|
|
|
struct A {
|
|
|
|
enum E : int{a}; // OK, enum definition
|
2020-05-11 04:58:42 +08:00
|
|
|
enum E : int(a); // OK, bit-field declaration cxx11-error{{anonymous bit-field}}
|
2020-05-11 04:39:23 +08:00
|
|
|
};
|
|
|
|
_Static_assert(A::a == 0, "");
|