From: Richard Smith Date: Fri, 7 Jun 2013 20:03:01 +0000 (+0000) Subject: PR16273: Weaken a bogus assertion. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=33f0faa082b1aa5b52ae50f2ccaffc34629e01da;p=clang PR16273: Weaken a bogus assertion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183550 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index 8621a2d42d..9531b2e91d 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -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()->isBeingDefined()) && "Caller should have completed object type"); // Template names cannot appear inside an Objective-C class or object type. diff --git a/test/SemaCXX/trailing-return-0x.cpp b/test/SemaCXX/trailing-return-0x.cpp index bd601db2ac..f7e3433a76 100644 --- a/test/SemaCXX/trailing-return-0x.cpp +++ b/test/SemaCXX/trailing-return-0x.cpp @@ -94,3 +94,11 @@ namespace DR1608 { auto f() -> decltype((*this)[0]); // expected-error {{cannot be overloaded}} }; } + +namespace PR16273 { + struct A { + template void f(); + auto g()->decltype(this->f<0>()); + }; +} +