[cfe-commits] r124573 - in /cfe/trunk: lib/Parse/ParseDecl.cpp test/Parser/MicrosoftExtensions.cpp

Francois Pichet pichet2000 at gmail.com
Sun Jan 30 20:54:32 PST 2011


Author: fpichet
Date: Sun Jan 30 22:54:32 2011
New Revision: 124573

URL: http://llvm.org/viewvc/llvm-project?rev=124573&view=rev
Log:
Allow Microsoft attributes in a constructor's parameter list.
This fixes a few compile errors when parsing <regex> from MSVC 2008 with clang.

Modified:
    cfe/trunk/lib/Parse/ParseDecl.cpp
    cfe/trunk/test/Parser/MicrosoftExtensions.cpp

Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=124573&r1=124572&r2=124573&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDecl.cpp Sun Jan 30 22:54:32 2011
@@ -2512,6 +2512,10 @@
   if (SS.isSet() && Actions.ShouldEnterDeclaratorScope(getCurScope(), SS))
     DeclScopeObj.EnterDeclaratorScope();
 
+  // Optionally skip Microsoft attributes.
+  ParsedAttributes Attrs;
+  MaybeParseMicrosoftAttributes(Attrs);
+
   // Check whether the next token(s) are part of a declaration
   // specifier, in which case we have the start of a parameter and,
   // therefore, we know that this is a constructor.

Modified: cfe/trunk/test/Parser/MicrosoftExtensions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/MicrosoftExtensions.cpp?rev=124573&r1=124572&r2=124573&view=diff
==============================================================================
--- cfe/trunk/test/Parser/MicrosoftExtensions.cpp (original)
+++ cfe/trunk/test/Parser/MicrosoftExtensions.cpp Sun Jan 30 22:54:32 2011
@@ -22,6 +22,14 @@
   int foo5([SA_Post(attr=1)] void *param);
 }
 
+class class_attr {
+public:
+  class_attr([SA_Pre(Null=SA_No,NullTerminated=SA_Yes)]  int a)
+  {
+  }
+};
+
+
 
 void uuidof_test1()
 {  





More information about the cfe-commits mailing list