]> granicus.if.org Git - clang/commitdiff
[Sema] Remove some conditions of a failing assert
authorErik Pilkington <erik.pilkington@gmail.com>
Wed, 5 Dec 2018 00:43:11 +0000 (00:43 +0000)
committerErik Pilkington <erik.pilkington@gmail.com>
Wed, 5 Dec 2018 00:43:11 +0000 (00:43 +0000)
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

lib/AST/DeclTemplate.cpp
test/SemaCXX/friend-template-redecl.cpp

index de1b7101fb93607f7a1677a502757894734cc313..04e1803281bede09279d603aa56ca63a3464741b 100644 (file)
@@ -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;
index 3e05964fb28823bff9ea1f4fa84cb0a2d32d5f2f..308cfcf540021982b8c954f56e44c12607a153f3 100644 (file)
@@ -18,3 +18,14 @@ void f() {
   foo(x);
   bar(x);
 }
+
+namespace PR39742 {
+template<typename>
+struct wrapper {
+  template<typename>
+  friend void friend_function_template() {}
+};
+
+wrapper<bool> x;
+wrapper<int> y;
+}