diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2017-04-19 05:25:13 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2017-04-19 05:25:13 +0000 |
commit | bd186c0787844f4d9111e5a918c457ad9e830e8c (patch) | |
tree | e905edadea2e5376a0d8537d72f8f62762319ef4 /clang/lib/AST/DeclCXX.cpp | |
parent | 73daaa8fb25385d4b664a3e174985b08b4b3db59 (diff) | |
download | bcm5719-llvm-bd186c0787844f4d9111e5a918c457ad9e830e8c.tar.gz bcm5719-llvm-bd186c0787844f4d9111e5a918c457ad9e830e8c.zip |
Revert r300653 and r300650. The underlying commit fixes one issue with
modules but exposes much more widespread issues. Example and more
information is on the review thread for r300650.
Original commit summary:
[modules] Properly look up the owning module for an instantiation of a merged template.
llvm-svn: 300659
Diffstat (limited to 'clang/lib/AST/DeclCXX.cpp')
-rw-r--r-- | clang/lib/AST/DeclCXX.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp index dd8f768c571..2e5cec9c108 100644 --- a/clang/lib/AST/DeclCXX.cpp +++ b/clang/lib/AST/DeclCXX.cpp @@ -1364,13 +1364,6 @@ CXXRecordDecl::setTemplateSpecializationKind(TemplateSpecializationKind TSK) { } const CXXRecordDecl *CXXRecordDecl::getTemplateInstantiationPattern() const { - auto GetDefinitionOrSelf = - [](const CXXRecordDecl *D) -> const CXXRecordDecl * { - if (auto *Def = D->getDefinition()) - return Def; - return D; - }; - // If it's a class template specialization, find the template or partial // specialization from which it was instantiated. if (auto *TD = dyn_cast<ClassTemplateSpecializationDecl>(this)) { @@ -1381,7 +1374,7 @@ const CXXRecordDecl *CXXRecordDecl::getTemplateInstantiationPattern() const { break; CTD = NewCTD; } - return GetDefinitionOrSelf(CTD->getTemplatedDecl()); + return CTD->getTemplatedDecl()->getDefinition(); } if (auto *CTPSD = From.dyn_cast<ClassTemplatePartialSpecializationDecl *>()) { @@ -1390,7 +1383,7 @@ const CXXRecordDecl *CXXRecordDecl::getTemplateInstantiationPattern() const { break; CTPSD = NewCTPSD; } - return GetDefinitionOrSelf(CTPSD); + return CTPSD->getDefinition(); } } @@ -1399,7 +1392,7 @@ const CXXRecordDecl *CXXRecordDecl::getTemplateInstantiationPattern() const { const CXXRecordDecl *RD = this; while (auto *NewRD = RD->getInstantiatedFromMemberClass()) RD = NewRD; - return GetDefinitionOrSelf(RD); + return RD->getDefinition(); } } |