diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-09-03 23:11:22 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-09-03 23:11:22 +0000 |
commit | f463436d9c02deb870f2ecbba4a69a96f6f9b3d7 (patch) | |
tree | 5810630f0ac6f5e0529de79d06c3179787871727 /clang/lib/Serialization/ASTCommon.cpp | |
parent | c6ab01eccae05aee4bae81a875a6eb88907247c5 (diff) | |
download | bcm5719-llvm-f463436d9c02deb870f2ecbba4a69a96f6f9b3d7.tar.gz bcm5719-llvm-f463436d9c02deb870f2ecbba4a69a96f6f9b3d7.zip |
[modules] Make NamespaceAliasDecl redeclarable, as it should be. This fixes
merging of namespace aliases across modules and improves source fidelity.
Incidentally also fixes PR20816.
llvm-svn: 217103
Diffstat (limited to 'clang/lib/Serialization/ASTCommon.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTCommon.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/Serialization/ASTCommon.cpp b/clang/lib/Serialization/ASTCommon.cpp index ba20f281ea7..13393225b60 100644 --- a/clang/lib/Serialization/ASTCommon.cpp +++ b/clang/lib/Serialization/ASTCommon.cpp @@ -151,7 +151,7 @@ bool serialization::isRedeclarableDeclKind(unsigned Kind) { switch (static_cast<Decl::Kind>(Kind)) { case Decl::TranslationUnit: // Special case of a "merged" declaration. case Decl::Namespace: - case Decl::NamespaceAlias: // FIXME: Not yet redeclarable, but will be. + case Decl::NamespaceAlias: case Decl::Typedef: case Decl::TypeAlias: case Decl::Enum: @@ -189,8 +189,6 @@ bool serialization::isRedeclarableDeclKind(unsigned Kind) { case Decl::MSProperty: case Decl::ObjCIvar: case Decl::ObjCAtDefsField: - case Decl::ImplicitParam: - case Decl::ParmVar: case Decl::NonTypeTemplateParm: case Decl::TemplateTemplateParm: case Decl::Using: @@ -213,6 +211,12 @@ bool serialization::isRedeclarableDeclKind(unsigned Kind) { case Decl::Import: case Decl::OMPThreadPrivate: return false; + + // These indirectly derive from Redeclarable<T> but are not actually + // redeclarable. + case Decl::ImplicitParam: + case Decl::ParmVar: + return false; } llvm_unreachable("Unhandled declaration kind"); |