aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-07-08 13:09:41 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-07-08 13:09:41 +0000
commit82f8e796d6ffce1d63729a2df87c1060edf6593a (patch)
tree8e6c1e3722bf09cc912783d94a522703b24d626c
parent9705752be3a52d72e9ad1c7c8d8e59082e40a4f1 (diff)
Fix reading of UsingDecl from PCH.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107871 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/AST/DeclCXX.h3
-rw-r--r--lib/Frontend/PCHReaderDecl.cpp4
2 files changed, 6 insertions, 1 deletions
diff --git a/include/clang/AST/DeclCXX.h b/include/clang/AST/DeclCXX.h
index 1b7958a5fd..41474ab21e 100644
--- a/include/clang/AST/DeclCXX.h
+++ b/include/clang/AST/DeclCXX.h
@@ -2082,6 +2082,9 @@ public:
static bool classof(const Decl *D) { return classofKind(D->getKind()); }
static bool classof(const UsingDecl *D) { return true; }
static bool classofKind(Kind K) { return K == Using; }
+
+ friend class PCHDeclReader;
+ friend class PCHDeclWriter;
};
/// UnresolvedUsingValueDecl - Represents a dependent using
diff --git a/lib/Frontend/PCHReaderDecl.cpp b/lib/Frontend/PCHReaderDecl.cpp
index 0233886abe..e392cd156e 100644
--- a/lib/Frontend/PCHReaderDecl.cpp
+++ b/lib/Frontend/PCHReaderDecl.cpp
@@ -609,7 +609,9 @@ void PCHDeclReader::VisitUsingDecl(UsingDecl *D) {
// would avoid existence checks.
unsigned NumShadows = Record[Idx++];
for(unsigned I = 0; I != NumShadows; ++I) {
- D->addShadowDecl(cast<UsingShadowDecl>(Reader.GetDecl(Record[Idx++])));
+ // Avoid invariant checking of UsingDecl::addShadowDecl, the decl may still
+ // be initializing.
+ D->Shadows.insert(cast<UsingShadowDecl>(Reader.GetDecl(Record[Idx++])));
}
D->setTypeName(Record[Idx++]);
NamedDecl *Pattern = cast_or_null<NamedDecl>(Reader.GetDecl(Record[Idx++]));