From: Erik Pilkington Date: Wed, 5 Dec 2018 00:43:11 +0000 (+0000) Subject: [Sema] Remove some conditions of a failing assert X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=82a30912df0dc5f08a1ba19e92f47bbd08054971;p=clang [Sema] Remove some conditions of a failing assert We should have been checking that this state is consistent, but its possible for it to be filled later, so it isn't really sound to check it here anyways. Fixes llvm.org/PR39742 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348325 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/DeclTemplate.cpp b/lib/AST/DeclTemplate.cpp index de1b7101fb..04e1803281 100644 --- a/lib/AST/DeclTemplate.cpp +++ b/lib/AST/DeclTemplate.cpp @@ -329,8 +329,6 @@ void FunctionTemplateDecl::mergePrevDecl(FunctionTemplateDecl *Prev) { // Ensure we don't leak any important state. assert(ThisCommon->Specializations.size() == 0 && - !ThisCommon->InstantiatedFromMember.getPointer() && - !ThisCommon->InstantiatedFromMember.getInt() && "Can't merge incompatible declarations!"); Base::Common = PrevCommon; diff --git a/test/SemaCXX/friend-template-redecl.cpp b/test/SemaCXX/friend-template-redecl.cpp index 3e05964fb2..308cfcf540 100644 --- a/test/SemaCXX/friend-template-redecl.cpp +++ b/test/SemaCXX/friend-template-redecl.cpp @@ -18,3 +18,14 @@ void f() { foo(x); bar(x); } + +namespace PR39742 { +template +struct wrapper { + template + friend void friend_function_template() {} +}; + +wrapper x; +wrapper y; +}