aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/Parser.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-12-09 21:39:38 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-12-09 21:39:38 +0000
commit3acd9aaa4ddd14afecb4f1c02ca6f585a6d51849 (patch)
treed1d308e96238e9f98c2d23c7196d4deb68c07cba /lib/Parse/Parser.cpp
parent39406b1395f69341c045e863a6620310abdc55b6 (diff)
Fixes a bogus error when declaring an extern "C" array.
(fixes radar 7457109). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90986 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/Parser.cpp')
-rw-r--r--lib/Parse/Parser.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp
index 20e5c589d7..b6e566518f 100644
--- a/lib/Parse/Parser.cpp
+++ b/lib/Parse/Parser.cpp
@@ -533,10 +533,10 @@ bool Parser::isStartOfFunctionDefinition() {
/// [OMP] threadprivate-directive [TODO]
///
Parser::DeclGroupPtrTy
-Parser::ParseDeclarationOrFunctionDefinition(AttributeList *Attr,
+Parser::ParseDeclarationOrFunctionDefinition(ParsingDeclSpec &DS,
+ AttributeList *Attr,
AccessSpecifier AS) {
// Parse the common declaration-specifiers piece.
- ParsingDeclSpec DS(*this);
if (Attr)
DS.AddAttributes(Attr);
@@ -585,13 +585,20 @@ Parser::ParseDeclarationOrFunctionDefinition(AttributeList *Attr,
DS.getStorageClassSpec() == DeclSpec::SCS_extern &&
DS.getParsedSpecifiers() == DeclSpec::PQ_StorageClassSpecifier) {
DS.abort();
- DeclPtrTy TheDecl = ParseLinkage(Declarator::FileContext);
+ DeclPtrTy TheDecl = ParseLinkage(DS, Declarator::FileContext);
return Actions.ConvertDeclToDeclGroup(TheDecl);
}
return ParseDeclGroup(DS, Declarator::FileContext, true);
}
+Parser::DeclGroupPtrTy
+Parser::ParseDeclarationOrFunctionDefinition(AttributeList *Attr,
+ AccessSpecifier AS) {
+ ParsingDeclSpec DS(*this);
+ return ParseDeclarationOrFunctionDefinition(DS, Attr, AS);
+}
+
/// ParseFunctionDefinition - We parsed and verified that the specified
/// Declarator is well formed. If this is a K&R-style function, read the
/// parameters declaration-list, then start the compound-statement.