summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseTemplate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-10-30 22:09:44 +0000
committerDouglas Gregor <dgregor@apple.com>2009-10-30 22:09:44 +0000
commit1d0015f8e133556fe88c52d594f0f72952e78210 (patch)
tree2f74bd8795383fcd91aaf3c875a6b5b2aa7c76cd /clang/lib/Parse/ParseTemplate.cpp
parent13cb2810130493c17d28c3c8d89595962a13f7f0 (diff)
downloadbcm5719-llvm-1d0015f8e133556fe88c52d594f0f72952e78210.tar.gz
bcm5719-llvm-1d0015f8e133556fe88c52d594f0f72952e78210.zip
Improved fix for PR3844, which recovers better for class template
partial specializations and explicit instantiations of non-templates. llvm-svn: 85620
Diffstat (limited to 'clang/lib/Parse/ParseTemplate.cpp')
-rw-r--r--clang/lib/Parse/ParseTemplate.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseTemplate.cpp b/clang/lib/Parse/ParseTemplate.cpp
index 8e63fb89db3..64c5a08933a 100644
--- a/clang/lib/Parse/ParseTemplate.cpp
+++ b/clang/lib/Parse/ParseTemplate.cpp
@@ -101,6 +101,7 @@ Parser::ParseTemplateDeclarationOrSpecialization(unsigned Context,
// (and retrieves the outer template parameter list from its
// context).
bool isSpecialization = true;
+ bool LastParamListWasEmpty = false;
TemplateParameterLists ParamLists;
TemplateParameterDepthCounter Depth(TemplateParameterDepth);
do {
@@ -140,13 +141,16 @@ Parser::ParseTemplateDeclarationOrSpecialization(unsigned Context,
if (!TemplateParams.empty()) {
isSpecialization = false;
++Depth;
+ } else {
+ LastParamListWasEmpty = true;
}
} while (Tok.is(tok::kw_export) || Tok.is(tok::kw_template));
// Parse the actual template declaration.
return ParseSingleDeclarationAfterTemplate(Context,
ParsedTemplateInfo(&ParamLists,
- isSpecialization),
+ isSpecialization,
+ LastParamListWasEmpty),
DeclEnd, AS);
}
OpenPOWER on IntegriCloud