On 09/20/2011 03:45 PM, Paolo Carlini wrote:
On 09/20/2011 03:12 PM, Jason Merrill wrote:
No, I think we want to complain about __int128 when -pedantic unless we're in a system header, as C does. The right fix is to move the __int128 code out of the if (unsigned_p || ...) block, and to suppress the pedwarn when in_system_header.
Ok, I'll do it...
As a preview, something as simple as the below appears to do what we want. I'll test it later with testcases (I think we want two: one testing sane error messages for a normal run of the testsuite; one testing the in_system_header suppression with the snippet included as a *.h), repost...

Thanks,
Paolo.
Index: decl.c
===================================================================
--- decl.c      (revision 179007)
+++ decl.c      (working copy)
@@ -8640,6 +8640,10 @@ grokdeclarator (const cp_declarator *declarator,
 
   ctype = NULL_TREE;
 
+  if (explicit_int128 && pedantic && ! in_system_header)
+    pedwarn (input_location, OPT_pedantic,
+            "ISO C++ does not support %<__int128%> for %qs", name);
+
   /* Now process the modifiers that were specified
      and check for invalid combinations.  */
 
@@ -8695,22 +8699,6 @@ grokdeclarator (const cp_declarator *declarator,
              if (flag_pedantic_errors)
                ok = 0;
            }
-         if (explicit_int128)
-           {
-             if (int128_integer_type_node == NULL_TREE)
-               {
-                 error ("%<__int128%> is not supported by this target");
-                 ok = 0;
-               }
-             else if (pedantic)
-               {
-                 pedwarn (input_location, OPT_pedantic,
-                          "ISO C++ does not support %<__int128%> for %qs",
-                          name);
-                 if (flag_pedantic_errors)
-                   ok = 0;
-               }
-           }
        }
 
       /* Discard the type modifiers if they are invalid.  */

Reply via email to