@@ -1964,9 +1964,14 @@ class TagDecl
1964
1964
unsigned NumPositiveBits : 8 ;
1965
1965
unsigned NumNegativeBits : 8 ;
1966
1966
1967
- // / IsScoped - True if this is tag declaration is a scoped enumeration. Only
1967
+ // / IsScoped - True if this tag declaration is a scoped enumeration. Only
1968
1968
// / possible in C++0x mode.
1969
1969
bool IsScoped : 1 ;
1970
+ // / IsScopedUsingClassTag - If this tag declaration is a scoped enum,
1971
+ // / then this is true if the scoped enum was declared using the class
1972
+ // / tag, false if it was declared with the struct tag. No meaning is
1973
+ // / associated if this tag declaration is not a scoped enum.
1974
+ bool IsScopedUsingClassTag : 1 ;
1970
1975
1971
1976
// / IsFixed - True if this is an enumeration with fixed underlying type. Only
1972
1977
// / possible in C++0x mode.
@@ -2189,12 +2194,14 @@ class EnumDecl : public TagDecl {
2189
2194
2190
2195
EnumDecl (DeclContext *DC, SourceLocation L,
2191
2196
IdentifierInfo *Id, EnumDecl *PrevDecl, SourceLocation TKL,
2192
- bool Scoped, bool Fixed )
2197
+ bool Scoped, bool ScopedUsingClassTag, bool Fixed )
2193
2198
: TagDecl(Enum, TTK_Enum, DC, L, Id, PrevDecl, TKL), InstantiatedFrom(0 ) {
2199
+ assert (Scoped || !ScopedUsingClassTag);
2194
2200
IntegerType = (const Type*)0 ;
2195
2201
NumNegativeBits = 0 ;
2196
2202
NumPositiveBits = 0 ;
2197
2203
IsScoped = Scoped;
2204
+ IsScopedUsingClassTag = ScopedUsingClassTag;
2198
2205
IsFixed = Fixed ;
2199
2206
}
2200
2207
public:
@@ -2215,7 +2222,8 @@ class EnumDecl : public TagDecl {
2215
2222
static EnumDecl *Create (ASTContext &C, DeclContext *DC,
2216
2223
SourceLocation L, IdentifierInfo *Id,
2217
2224
SourceLocation TKL, EnumDecl *PrevDecl,
2218
- bool IsScoped, bool IsFixed);
2225
+ bool IsScoped, bool IsScopedUsingClassTag,
2226
+ bool IsFixed);
2219
2227
static EnumDecl *Create (ASTContext &C, EmptyShell Empty);
2220
2228
2221
2229
// / completeDefinition - When created, the EnumDecl corresponds to a
@@ -2306,6 +2314,11 @@ class EnumDecl : public TagDecl {
2306
2314
return IsScoped;
2307
2315
}
2308
2316
2317
+ // / \brief Returns true if this is a C++0x scoped enumeration.
2318
+ bool isScopedUsingClassTag () const {
2319
+ return IsScopedUsingClassTag;
2320
+ }
2321
+
2309
2322
// / \brief Returns true if this is a C++0x enumeration with fixed underlying
2310
2323
// / type.
2311
2324
bool isFixed () const {
0 commit comments