forked from OSchip/llvm-project
Tweak my fix for PR8748, and update the incorrect PR number in the test case.
llvm-svn: 124863
This commit is contained in:
parent
87866ceda7
commit
4d5c297607
|
@ -3972,7 +3972,8 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
|
|||
? TPC_FriendFunctionTemplateDefinition
|
||||
: TPC_FriendFunctionTemplate)
|
||||
: (D.getCXXScopeSpec().isSet() &&
|
||||
DC && DC->isRecord())
|
||||
DC && DC->isRecord() &&
|
||||
DC->isDependentContext())
|
||||
? TPC_ClassTemplateMember
|
||||
: TPC_FunctionTemplate);
|
||||
}
|
||||
|
|
|
@ -947,7 +947,8 @@ Sema::CheckClassTemplate(Scope *S, unsigned TagSpec, TagUseKind TUK,
|
|||
if (CheckTemplateParameterList(TemplateParams,
|
||||
PrevClassTemplate? PrevClassTemplate->getTemplateParameters() : 0,
|
||||
(SS.isSet() && SemanticContext &&
|
||||
SemanticContext->isRecord())
|
||||
SemanticContext->isRecord() &&
|
||||
SemanticContext->isDependentContext())
|
||||
? TPC_ClassTemplateMember
|
||||
: TPC_ClassTemplate))
|
||||
Invalid = true;
|
||||
|
|
|
@ -22,10 +22,10 @@ struct X3 {
|
|||
}
|
||||
};
|
||||
|
||||
namespace PR8747 {
|
||||
namespace PR8748 {
|
||||
// Testcase 1
|
||||
struct A0 { template<typename U> struct B; };
|
||||
template<typename U = int> struct A0::B { }; // expected-error{{cannot add a default template argument to the definition of a member of a class template}}
|
||||
template<typename U = int> struct A0::B { };
|
||||
|
||||
// Testcase 2
|
||||
template<typename T> struct A1 { template<typename U> struct B; };
|
||||
|
|
Loading…
Reference in New Issue