diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2011-04-29 08:19:30 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2011-04-29 08:19:30 +0000 |
commit | 2ac2c725e00e114cc9f3091349a83a791a20cef7 (patch) | |
tree | d2e59b8c8bc0269d3ecfa3218860cda0698ed861 /clang/lib/Serialization/ASTWriter.cpp | |
parent | b00047a4759972a6cc9dadd41517ff0e824e11d2 (diff) | |
download | bcm5719-llvm-2ac2c725e00e114cc9f3091349a83a791a20cef7.tar.gz bcm5719-llvm-2ac2c725e00e114cc9f3091349a83a791a20cef7.zip |
Add a decl update when a static data member of a class template is instantiated in a different PCH than its containing class. Otherwise we get double definition errors. Fixes a Boost.MPL problem that affects Boost.Accumulators and probably a lot more of Boost.
llvm-svn: 130488
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTWriter.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 9616f8bfd75..c163cf3d99f 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -3955,4 +3955,16 @@ void ASTWriter::CompletedImplicitDefinition(const FunctionDecl *D) { RewriteDecl(D); } +void ASTWriter::StaticDataMemberInstantiated(const VarDecl *D) { + if (D->getPCHLevel() == 0) + return; + + // Since the actual instantiation is delayed, this really means that we need + // to update the instantiation location. + UpdateRecord &Record = DeclUpdates[D]; + Record.push_back(UPD_CXX_INSTANTIATED_STATIC_DATA_MEMBER); + AddSourceLocation( + D->getMemberSpecializationInfo()->getPointOfInstantiation(), Record); +} + ASTSerializationListener::~ASTSerializationListener() { } |