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 | 5ee3734c0b5222a7c445591a1f14102c1b3a289b (patch) | |
tree | 9704c869111c8dcdda4e75100b2861e3636f29e0 /lib/Parse/ParseDeclCXX.cpp | |
parent | c53a844e22c5a635c64ede7e1ac31fb035e52701 (diff) |
Don't try to parse class template specializations in C. It can only
lead to heartache. Fixes <rdar://problem/8044088>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105178 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDeclCXX.cpp')
-rw-r--r-- | lib/Parse/ParseDeclCXX.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index ce6147ae89..7e59170b37 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/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()); |