diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-03-05 00:26:45 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-03-05 00:26:45 +0000 |
commit | 90d4717767dbad1a7cae71852789db09c8f46cdc (patch) | |
tree | 64005377aa48a2b75d279932e2b6cd9a68ef14e0 /clang/lib/AST/DeclBase.cpp | |
parent | 6517f88f25f0687e563526c0b934d2bcf9211130 (diff) | |
download | bcm5719-llvm-90d4717767dbad1a7cae71852789db09c8f46cdc.tar.gz bcm5719-llvm-90d4717767dbad1a7cae71852789db09c8f46cdc.zip |
When we invalidate a declaration, make it public, so that it doesn't
trigger access control or one of the many assertions we have for valid
access specifiers.
llvm-svn: 97767
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r-- | clang/lib/AST/DeclBase.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index 47b7e7efb60..9db6ae1329e 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/lib/AST/DeclBase.cpp @@ -46,6 +46,16 @@ const char *Decl::getDeclKindName() const { } } +void Decl::setInvalidDecl(bool Invalid) { + InvalidDecl = Invalid; + if (Invalid) { + // Defensive maneuver for ill-formed code: we're likely not to make it to + // a point where we set the access specifier, so default it to "public" + // to avoid triggering asserts elsewhere in the front end. + setAccess(AS_public); + } +} + const char *DeclContext::getDeclKindName() const { switch (DeclKind) { default: assert(0 && "Declaration context not in DeclNodes.def!"); |