[cfe-commits] r159380 - in /cfe/trunk: lib/Parse/ParseCXXInlineMethods.cpp lib/Parse/Parser.cpp test/Parser/DelayedTemplateParsing.cpp
Douglas Gregor
dgregor at apple.com
Thu Jun 28 14:43:01 PDT 2012
Author: dgregor
Date: Thu Jun 28 16:43:01 2012
New Revision: 159380
URL: http://llvm.org/viewvc/llvm-project?rev=159380&view=rev
Log:
Support the use of "=delete" and "=default" with delayed template
parsing. Fixes <rdar://problem/11700604>.
Modified:
cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp
cfe/trunk/lib/Parse/Parser.cpp
cfe/trunk/test/Parser/DelayedTemplateParsing.cpp
Modified: cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp?rev=159380&r1=159379&r2=159380&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp (original)
+++ cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp Thu Jun 28 16:43:01 2012
@@ -109,6 +109,7 @@
// 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())) {
Modified: cfe/trunk/lib/Parse/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=159380&r1=159379&r2=159380&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/Parser.cpp (original)
+++ cfe/trunk/lib/Parse/Parser.cpp Thu Jun 28 16:43:01 2012
@@ -959,6 +959,7 @@
// 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(),
Modified: cfe/trunk/test/Parser/DelayedTemplateParsing.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/DelayedTemplateParsing.cpp?rev=159380&r1=159379&r2=159380&view=diff
==============================================================================
--- cfe/trunk/test/Parser/DelayedTemplateParsing.cpp (original)
+++ cfe/trunk/test/Parser/DelayedTemplateParsing.cpp Thu Jun 28 16:43:01 2012
@@ -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 @@
}
}
+
+namespace rdar11700604 {
+ template<typename T> void foo() = delete;
+
+ struct X {
+ X() = default;
+
+ template<typename T> void foo() = delete;
+ };
+}
+
More information about the cfe-commits
mailing list