]> granicus.if.org Git - clang/commitdiff
Handle decltype keyword in Parser::isDeclarationSpecifier.
authorFrancois Pichet <pichet2000@gmail.com>
Sun, 19 Jun 2011 08:02:06 +0000 (08:02 +0000)
committerFrancois Pichet <pichet2000@gmail.com>
Sun, 19 Jun 2011 08:02:06 +0000 (08:02 +0000)
Fixes PR10154. Found by parsing MFC 2010 code with clang.

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

lib/Parse/ParseDecl.cpp
test/SemaCXX/decltype.cpp

index 2d3fcf834031157a8ae32007711554803a5b668d..9af7345fdd63a09c3bad6d806d983996832da1ce 100644 (file)
@@ -3018,6 +3018,10 @@ bool Parser::isDeclarationSpecifier(bool DisambiguatingWithExpression) {
   case tok::kw___attribute:
     return true;
 
+    // C++0x decltype.
+  case tok::kw_decltype:
+    return true;
+
     // GNU ObjC bizarre protocol extension: <proto1,proto2> with implicit 'id'.
   case tok::less:
     return getLang().ObjC1;
index d4ef7e33a1d1a3280462b8f4c04a37e799b3fad7..f61a92b71e1e553845789ab6b254a43834ca6ff1 100644 (file)
@@ -16,3 +16,8 @@ void test_f2() {
   float &fr = f2(AC().a);
 }
 
+namespace pr10154 {
+  class A{
+      A(decltype(nullptr) param);
+  };
+}
\ No newline at end of file