Support the use of "=delete" and "=default" with delayed template
parsing. Fixes <rdar://problem/11700604>. llvm-svn: 159380
This commit is contained in:
parent
d9c8aace7b
commit
1edf57639a
|
@ -109,6 +109,7 @@ Decl *Parser::ParseCXXInlineMethodDef(AccessSpecifier AS,
|
|||
// or if we are about to parse function member template then consume
|
||||
// the tokens and store them for parsing at the end of the translation unit.
|
||||
if (getLangOpts().DelayedTemplateParsing &&
|
||||
DefinitionKind == FDK_Definition &&
|
||||
((Actions.CurContext->isDependentContext() ||
|
||||
TemplateInfo.Kind != ParsedTemplateInfo::NonTemplate) &&
|
||||
!Actions.IsInsideALocalClassWithinATemplateFunction())) {
|
||||
|
|
|
@ -959,6 +959,7 @@ Decl *Parser::ParseFunctionDefinition(ParsingDeclarator &D,
|
|||
// In delayed template parsing mode, for function template we consume the
|
||||
// tokens and store them for late parsing at the end of the translation unit.
|
||||
if (getLangOpts().DelayedTemplateParsing &&
|
||||
Tok.isNot(tok::equal) &&
|
||||
TemplateInfo.Kind == ParsedTemplateInfo::Template) {
|
||||
MultiTemplateParamsArg TemplateParameterLists(Actions,
|
||||
TemplateInfo.TemplateParams->data(),
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: %clang_cc1 -fms-extensions -fdelayed-template-parsing -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -fms-extensions -fdelayed-template-parsing -fsyntax-only -verify -std=c++11 %s
|
||||
|
||||
template <class T>
|
||||
class A {
|
||||
|
@ -90,3 +90,14 @@ Callback Bind() {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
namespace rdar11700604 {
|
||||
template<typename T> void foo() = delete;
|
||||
|
||||
struct X {
|
||||
X() = default;
|
||||
|
||||
template<typename T> void foo() = delete;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue