[PATCH] D12686: Add support for GCC's '__auto_type' extension.

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 10 13:19:03 PST 2015


rsmith accepted this revision.
rsmith added a reviewer: rsmith.
rsmith added a comment.
This revision is now accepted and ready to land.

This LGTM, do you have SVN access or would you like someone to commit for you?


================
Comment at: lib/Sema/SemaType.cpp:2616-2618
@@ -2616,5 +2615,5 @@
   // C++11 [dcl.spec.auto]p5: reject 'auto' if it is not in an allowed context.
   // In C++11, a function declarator using 'auto' must have a trailing return
   // type (this is checked later) and we can skip this. In other languages
   // using auto, we need to check regardless.
   // C++14 In generic lambdas allow 'auto' in their parameters.
----------------
This comment is out of date. Delete these three lines?

================
Comment at: lib/Sema/SemaType.cpp:3767-3771
@@ -3743,7 +3766,7 @@
           }
         }
       }
 
       // C99 6.7.5.3p1: The return type may not be a function or array type.
       // For conversion functions, we'll diagnose this particular error later.
       if ((T->isArrayType() || T->isFunctionType()) &&
----------------
Does this change also fix PR25449?

================
Comment at: test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p7-1y.cpp:52
@@ -51,3 +51,3 @@
 const decltype(auto) f4(); // expected-error {{'decltype(auto)' cannot be combined with other type specifiers}}
-typedef decltype(auto) f5(); // expected-error {{'decltype(auto)' can only be used as a return type in a function declaration}}
+typedef decltype(auto) f5(); // expected-error {{'decltype(auto)' not allowed in typedef}}
 decltype(auto) ((((((f6))))())); // ok
----------------
Thanks, this new diagnostic is a lot better :)


http://reviews.llvm.org/D12686





More information about the cfe-commits mailing list