]> granicus.if.org Git - clang/commitdiff
Allow Microsoft attributes in a constructor's parameter list.
authorFrancois Pichet <pichet2000@gmail.com>
Mon, 31 Jan 2011 04:54:32 +0000 (04:54 +0000)
committerFrancois Pichet <pichet2000@gmail.com>
Mon, 31 Jan 2011 04:54:32 +0000 (04:54 +0000)
This fixes a few compile errors when parsing <regex> from MSVC 2008 with clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124573 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseDecl.cpp
test/Parser/MicrosoftExtensions.cpp

index c4fce66b65779b513a01c10f34dec6e8ff9caabb..24e41d073799fa775d8557e692b804bd1a2f4d2c 100644 (file)
@@ -2512,6 +2512,10 @@ bool Parser::isConstructorDeclarator() {
   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.
index 1d5811496a76bf279e0c8fa2fb62a442497dfcc8..fd0d7d50d0eb07b3d3970a6a1d9cacde12160da9 100644 (file)
@@ -22,6 +22,14 @@ extern "C" {
   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()
 {