[llvm-branch-commits] [cfe-branch] r105184 - in /cfe/branches/Apple/whitney: lib/Parse/ParseDeclCXX.cpp test/Parser/declarators.c
Daniel Dunbar
daniel at zuster.org
Sun May 30 16:40:57 PDT 2010
Author: ddunbar
Date: Sun May 30 18:40:57 2010
New Revision: 105184
URL: http://llvm.org/viewvc/llvm-project?rev=105184&view=rev
Log:
Merge r105178:
--
Author: Douglas Gregor <dgregor at apple.com>
Date: Sun May 30 22:30:21 2010 +0000
Don't try to parse class template specializations in C. It can only
lead to heartache. Fixes <rdar://problem/8044088>.
Modified:
cfe/branches/Apple/whitney/lib/Parse/ParseDeclCXX.cpp
cfe/branches/Apple/whitney/test/Parser/declarators.c
Modified: cfe/branches/Apple/whitney/lib/Parse/ParseDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/lib/Parse/ParseDeclCXX.cpp?rev=105184&r1=105183&r2=105184&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/branches/Apple/whitney/lib/Parse/ParseDeclCXX.cpp Sun May 30 18:40:57 2010
@@ -670,7 +670,7 @@
Name = Tok.getIdentifierInfo();
NameLoc = ConsumeToken();
- if (Tok.is(tok::less)) {
+ if (Tok.is(tok::less) && getLang().CPlusPlus) {
// The name was supposed to refer to a template, but didn't.
// Eat the template argument list and try to continue parsing this as
// a class (or template thereof).
@@ -713,8 +713,6 @@
const_cast<ParsedTemplateInfo&>(TemplateInfo).ExternLoc
= SourceLocation();
}
-
-
}
} else if (Tok.is(tok::annot_template_id)) {
TemplateId = static_cast<TemplateIdAnnotation *>(Tok.getAnnotationValue());
Modified: cfe/branches/Apple/whitney/test/Parser/declarators.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/test/Parser/declarators.c?rev=105184&r1=105183&r2=105184&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/test/Parser/declarators.c (original)
+++ cfe/branches/Apple/whitney/test/Parser/declarators.c Sun May 30 18:40:57 2010
@@ -83,3 +83,6 @@
// rdar://7608537
struct test13 { int a; } (test13x);
+
+// <rdar://problem/8044088>
+struct X<foo::int> { }; // expected-error{{expected identifier or '('}}
More information about the llvm-branch-commits
mailing list