diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-05-30 22:30:21 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-05-30 22:30:21 +0000 |
| commit | d5a479cbb5fd4ae4a71433a066cb16dfc9db5904 (patch) | |
| tree | b01bc11d6f26bafe550b06180ccc2949ff6ededc /clang | |
| parent | 3dbd7b51ca1367eccfe77bf05b677007c3d77903 (diff) | |
| download | bcm5719-llvm-d5a479cbb5fd4ae4a71433a066cb16dfc9db5904.tar.gz bcm5719-llvm-d5a479cbb5fd4ae4a71433a066cb16dfc9db5904.zip | |
Don't try to parse class template specializations in C. It can only
lead to heartache. Fixes <rdar://problem/8044088>.
llvm-svn: 105178
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Parse/ParseDeclCXX.cpp | 4 | ||||
| -rw-r--r-- | clang/test/Parser/declarators.c | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp index ce6147ae894..7e59170b370 100644 --- a/clang/lib/Parse/ParseDeclCXX.cpp +++ b/clang/lib/Parse/ParseDeclCXX.cpp @@ -670,7 +670,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, 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 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, const_cast<ParsedTemplateInfo&>(TemplateInfo).ExternLoc = SourceLocation(); } - - } } else if (Tok.is(tok::annot_template_id)) { TemplateId = static_cast<TemplateIdAnnotation *>(Tok.getAnnotationValue()); diff --git a/clang/test/Parser/declarators.c b/clang/test/Parser/declarators.c index 31712af26c7..a82122ec35f 100644 --- a/clang/test/Parser/declarators.c +++ b/clang/test/Parser/declarators.c @@ -83,3 +83,6 @@ void test12() { // rdar://7608537 struct test13 { int a; } (test13x); + +// <rdar://problem/8044088> +struct X<foo::int> { }; // expected-error{{expected identifier or '('}} |

