[cfe-commits] r133380 - in /cfe/trunk: lib/Parse/ParseDecl.cpp test/SemaCXX/decltype.cpp
Francois Pichet
pichet2000 at gmail.com
Sun Jun 19 01:02:06 PDT 2011
Author: fpichet
Date: Sun Jun 19 03:02:06 2011
New Revision: 133380
URL: http://llvm.org/viewvc/llvm-project?rev=133380&view=rev
Log:
Handle decltype keyword in Parser::isDeclarationSpecifier.
Fixes PR10154. Found by parsing MFC 2010 code with clang.
Modified:
cfe/trunk/lib/Parse/ParseDecl.cpp
cfe/trunk/test/SemaCXX/decltype.cpp
Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=133380&r1=133379&r2=133380&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDecl.cpp Sun Jun 19 03:02:06 2011
@@ -3018,6 +3018,10 @@
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;
Modified: cfe/trunk/test/SemaCXX/decltype.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/decltype.cpp?rev=133380&r1=133379&r2=133380&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/decltype.cpp (original)
+++ cfe/trunk/test/SemaCXX/decltype.cpp Sun Jun 19 03:02:06 2011
@@ -16,3 +16,8 @@
float &fr = f2(AC().a);
}
+namespace pr10154 {
+ class A{
+ A(decltype(nullptr) param);
+ };
+}
\ No newline at end of file
More information about the cfe-commits
mailing list