diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-03-23 03:33:32 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-03-23 03:33:32 +0000 |
commit | 7d137e3b98f4503e3a49b1d68fd552647f22fa33 (patch) | |
tree | 58e15e0a2bd8d433611ea1a50df00ac907e5fb9a /clang/lib/Parse/ParseDeclCXX.cpp | |
parent | a754a03550003a0f2b93d57e0854be5939814c33 (diff) | |
download | bcm5719-llvm-7d137e3b98f4503e3a49b1d68fd552647f22fa33.tar.gz bcm5719-llvm-7d137e3b98f4503e3a49b1d68fd552647f22fa33.zip |
Support for definitions of member enumerations of class templates outside the
class template's definition, and for explicit specializations of such enum
members.
llvm-svn: 153304
Diffstat (limited to 'clang/lib/Parse/ParseDeclCXX.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDeclCXX.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp index cf18a5b6294..9321c137fba 100644 --- a/clang/lib/Parse/ParseDeclCXX.cpp +++ b/clang/lib/Parse/ParseDeclCXX.cpp @@ -968,12 +968,9 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, // As an extension we do not perform access checking on the names used to // specify explicit specializations either. This is important to allow // specializing traits classes for private types. - bool SuppressingAccessChecks = false; - if (TemplateInfo.Kind == ParsedTemplateInfo::ExplicitInstantiation || - TemplateInfo.Kind == ParsedTemplateInfo::ExplicitSpecialization) { - Actions.ActOnStartSuppressingAccessChecks(); - SuppressingAccessChecks = true; - } + Sema::SuppressAccessChecksRAII SuppressAccess(Actions, + TemplateInfo.Kind == ParsedTemplateInfo::ExplicitInstantiation || + TemplateInfo.Kind == ParsedTemplateInfo::ExplicitSpecialization); ParsedAttributes attrs(AttrFactory); // If attributes exist after tag, parse them. @@ -1102,17 +1099,13 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, DS.SetTypeSpecError(); SkipUntil(tok::semi, false, true); - if (SuppressingAccessChecks) - Actions.ActOnStopSuppressingAccessChecks(); - return; } } // As soon as we're finished parsing the class's template-id, turn access // checking back on. - if (SuppressingAccessChecks) - Actions.ActOnStopSuppressingAccessChecks(); + SuppressAccess.done(); // There are four options here. // - If we are in a trailing return type, this is always just a reference, |