Never try to instantiate a deduction guide's "definition". Fixes bogus warning when there inevitably isn't one.

llvm-svn: 316820
This commit is contained in:
Richard Smith 2017-10-28 01:15:00 +00:00
parent 49687104d6
commit cb18957da0
2 changed files with 4 additions and 3 deletions

View File

@ -3768,7 +3768,8 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
bool Recursive, bool Recursive,
bool DefinitionRequired, bool DefinitionRequired,
bool AtEndOfTU) { bool AtEndOfTU) {
if (Function->isInvalidDecl() || Function->isDefined()) if (Function->isInvalidDecl() || Function->isDefined() ||
isa<CXXDeductionGuideDecl>(Function))
return; return;
// Never instantiate an explicit specialization except if it is a class scope // Never instantiate an explicit specialization except if it is a class scope

View File

@ -1,5 +1,5 @@
// RUN: %clang_cc1 -std=c++1z -verify %s -DERRORS // RUN: %clang_cc1 -std=c++1z -verify %s -DERRORS -Wundefined-func-template
// RUN: %clang_cc1 -std=c++1z -verify %s -UERRORS // RUN: %clang_cc1 -std=c++1z -verify %s -UERRORS -Wundefined-func-template
// This test is split into two because we only produce "undefined internal" // This test is split into two because we only produce "undefined internal"
// warnings if we didn't produce any errors. // warnings if we didn't produce any errors.