[llvm-branch-commits] [cfe-branch] r119241 - in /cfe/branches/Apple/whitney: lib/Parse/ParseDecl.cpp lib/Parse/ParseDeclCXX.cpp test/Parser/cxx-decl.cpp

Daniel Dunbar daniel at zuster.org
Mon Nov 15 13:45:30 PST 2010


Author: ddunbar
Date: Mon Nov 15 15:45:29 2010
New Revision: 119241

URL: http://llvm.org/viewvc/llvm-project?rev=119241&view=rev
Log:
Merge r118625:
--
Author: Chris Lattner <clattner at apple.com>
Date:   Tue Nov 9 20:14:26 2010 +0000

    fix PR8380, a crash on invalid due to an illogical DeclSpec SourceRange being constructed.

Modified:
    cfe/branches/Apple/whitney/lib/Parse/ParseDecl.cpp
    cfe/branches/Apple/whitney/lib/Parse/ParseDeclCXX.cpp
    cfe/branches/Apple/whitney/test/Parser/cxx-decl.cpp

Modified: cfe/branches/Apple/whitney/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/lib/Parse/ParseDecl.cpp?rev=119241&r1=119240&r2=119241&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/lib/Parse/ParseDecl.cpp (original)
+++ cfe/branches/Apple/whitney/lib/Parse/ParseDecl.cpp Mon Nov 15 15:45:29 2010
@@ -889,6 +889,7 @@
                                         AccessSpecifier AS,
                                         DeclSpecContext DSContext) {  
   DS.SetRangeStart(Tok.getLocation());
+  DS.SetRangeEnd(Tok.getLocation());
   while (1) {
     bool isInvalid = false;
     const char *PrevSpec = 0;

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=119241&r1=119240&r2=119241&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/branches/Apple/whitney/lib/Parse/ParseDeclCXX.cpp Mon Nov 15 15:45:29 2010
@@ -187,7 +187,6 @@
                                        unsigned Context) {
   assert(Tok.is(tok::string_literal) && "Not a string literal!");
   llvm::SmallString<8> LangBuffer;
-  // LangBuffer is guaranteed to be big enough.
   bool Invalid = false;
   llvm::StringRef Lang = PP.getSpelling(Tok, LangBuffer, &Invalid);
   if (Invalid)

Modified: cfe/branches/Apple/whitney/test/Parser/cxx-decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/test/Parser/cxx-decl.cpp?rev=119241&r1=119240&r2=119241&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/test/Parser/cxx-decl.cpp (original)
+++ cfe/branches/Apple/whitney/test/Parser/cxx-decl.cpp Mon Nov 15 15:45:29 2010
@@ -83,3 +83,14 @@
 
 void CodeCompleteConsumer::() { // expected-error {{xpected unqualified-id}}
 } 
+
+;
+
+// PR8380
+extern ""      // expected-error {{unknown linkage language}}
+test6a { ;// expected-error {{C++ requires a type specifier for all declarations}} \
+     // expected-error {{expected ';' after top level declarator}}
+  
+  int test6b;
+  
+  





More information about the llvm-branch-commits mailing list