Tighten the setAccess assert. We now allow AS_none if the decl contex is not a C++ record decl.
Also, fix fallout from the change.
llvm-svn: 67717
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 2201137..835792e 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -3384,7 +3384,9 @@
// lexical context will be different from the semantic context.
New->setLexicalDeclContext(CurContext);
- if (AS != AS_none)
+ if (PrevDecl)
+ New->setAccess(PrevDecl->getAccess());
+ else
New->setAccess(AS);
if (TK == TK_Definition)