From 374166d894121ea3cd67246a439b146502af3f3b Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 15 Feb 2017 03:29:24 +0000 Subject: [PATCH] Speculatively revert r295118 to see if it's what's causing the modules selfhost buildbots to fail. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295146 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/Type.cpp | 6 ++---- test/SemaTemplate/explicit-specialization-member.cpp | 11 ----------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 1d064b135e..8f22a1b197 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -3023,10 +3023,8 @@ static TagDecl *getInterestingTagDecl(TagDecl *decl) { if (I->isCompleteDefinition() || I->isBeingDefined()) return I; } - // If there's no definition (not even in progress), return the most recent - // declaration. This is important for template specializations, in order to - // pick the declaration with the most complete TemplateSpecializationKind. - return decl->getMostRecentDecl(); + // If there's no definition (not even in progress), return what we have. + return decl; } TagDecl *TagType::getDecl() const { diff --git a/test/SemaTemplate/explicit-specialization-member.cpp b/test/SemaTemplate/explicit-specialization-member.cpp index 4300ceb17e..f302836c7e 100644 --- a/test/SemaTemplate/explicit-specialization-member.cpp +++ b/test/SemaTemplate/explicit-specialization-member.cpp @@ -57,14 +57,3 @@ template struct Helper { template void Helper::func<2>() {} // expected-error {{cannot specialize a member}} \ // expected-error {{no function template matches}} } - -namespace b35070233 { - template struct Cls { - static void f() {} - }; - - void g(Cls); - - template<> struct Cls; // expected-note {{forward declaration}} - template<> void Cls::f(); // expected-error {{incomplete type}} -} -- 2.50.1