Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enforce the C++11 anonymous enum bitfields check even for
Objective-C++11 and under MS extensions. This matches the MSVC behavior, and means that Objective-C behaves as a set of extensions to the base language, rather than replacing the base language rule with a different one.
- Loading branch information
Showing
4 changed files
with
22 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
// RUN: %clang_cc1 -verify -std=c++98 %s | ||
// RUN: %clang_cc1 -verify=cxx11 -std=c++11 %s | ||
|
||
#if __cplusplus < 201103L | ||
// expected-no-diagnostics | ||
#endif | ||
|
||
// 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 | ||
enum E : int(a); // OK, bit-field declaration | ||
enum E : int(a); // OK, bit-field declaration cxx11-error{{anonymous bit-field}} | ||
}; | ||
_Static_assert(A::a == 0, ""); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters