It appears the problem is that the declspec is aborted prematurely in
ParseDeclerationOrFuncitonDefiniton(). Possible solution attached.

Keir
Index: test/CodeGenCXX/extern-c.cpp
===================================================================
--- test/CodeGenCXX/extern-c.cpp	(revision 95507)
+++ test/CodeGenCXX/extern-c.cpp	(working copy)
@@ -10,4 +10,7 @@
 // RUN: grep "@_ZN3foo1cE = global i32" %t | count 1
 int c = 5;
 
+// RUN: not grep "@_ZN3foo1dE" %t
+extern "C" struct d;
+
 }
Index: lib/Parse/ParseDeclCXX.cpp
===================================================================
--- lib/Parse/ParseDeclCXX.cpp	(revision 95507)
+++ lib/Parse/ParseDeclCXX.cpp	(working copy)
@@ -191,6 +191,8 @@
                                                    SourceLocation());
   }
 
+  DS.abort();
+
   if (Attr.HasAttr)
     Diag(Attr.Range.getBegin(), diag::err_attributes_not_allowed)
       << Attr.Range;
Index: lib/Parse/Parser.cpp
===================================================================
--- lib/Parse/Parser.cpp	(revision 95507)
+++ lib/Parse/Parser.cpp	(working copy)
@@ -593,7 +593,6 @@
   if (Tok.is(tok::string_literal) && getLang().CPlusPlus &&
       DS.getStorageClassSpec() == DeclSpec::SCS_extern &&
       DS.getParsedSpecifiers() == DeclSpec::PQ_StorageClassSpecifier) {
-    DS.abort();
     DeclPtrTy TheDecl = ParseLinkage(DS, Declarator::FileContext);
     return Actions.ConvertDeclToDeclGroup(TheDecl);
   }
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to