]> granicus.if.org Git - clang/commitdiff
PR16273: Weaken a bogus assertion.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 7 Jun 2013 20:03:01 +0000 (20:03 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 7 Jun 2013 20:03:01 +0000 (20:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183550 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaTemplate.cpp
test/SemaCXX/trailing-return-0x.cpp

index 8621a2d42dc62f5ab663b13cfd1fd36da7f652a9..9531b2e91df571b6074b37894d246e0775e4e8a6 100644 (file)
@@ -256,7 +256,8 @@ void Sema::LookupTemplateName(LookupResult &Found,
     assert(!SS.isSet() && "ObjectType and scope specifier cannot coexist");
     LookupCtx = computeDeclContext(ObjectType);
     isDependent = ObjectType->isDependentType();
-    assert((isDependent || !ObjectType->isIncompleteType()) &&
+    assert((isDependent || !ObjectType->isIncompleteType() ||
+            ObjectType->castAs<TagType>()->isBeingDefined()) &&
            "Caller should have completed object type");
     
     // Template names cannot appear inside an Objective-C class or object type.
index bd601db2ac1d4b60b5ff5b5550b6d7e07d10a69b..f7e3433a76086a0fe8d7e9889d0d833220d5d492 100644 (file)
@@ -94,3 +94,11 @@ namespace DR1608 {
     auto f() -> decltype((*this)[0]); // expected-error {{cannot be overloaded}}
   };
 }
+
+namespace PR16273 {
+  struct A {
+    template <int N> void f();
+    auto g()->decltype(this->f<0>());
+  };
+}
+