c-opts.c (sanitize_cpp_opts): Don't warn about "long long" when in C++0x mode.
authorDouglas Gregor <doug.gregor@gmail.com>
Wed, 2 Jan 2008 04:35:50 +0000 (04:35 +0000)
committerDoug Gregor <dgregor@gcc.gnu.org>
Wed, 2 Jan 2008 04:35:50 +0000 (04:35 +0000)
2008-01-01  Douglas Gregor  <doug.gregor@gmail.com>

       * c-opts.c (sanitize_cpp_opts): Don't warn about "long long" when
       in C++0x mode.

2008-01-01  Douglas Gregor  <doug.gregor@gmail.com>

       * parser.c (cp_parser_check_decl_spec): Don't warn about "long
       long" in C++0x mode; change the warning to note that "long long"
       is only unsupported in C++98 mode.

2008-01-01  Douglas Gregor  <doug.gregor@gmail.com>

       * g++.dg/cpp0x/long_long.C: New.

From-SVN: r131254

gcc/ChangeLog
gcc/c-opts.c
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/long_long.C [new file with mode: 0644]

index ce2f258..7fc21c4 100644 (file)
@@ -1,3 +1,8 @@
+2008-01-01  Douglas Gregor  <doug.gregor@gmail.com>
+
+       * c-opts.c (sanitize_cpp_opts): Don't warn about "long long" when
+       in C++0x mode.
+
 2008-01-01  Volker Reichelt  <v.reichelt@netcologne.de>
 
        PR libmudflap/26442
index a5c2270..3c62192 100644 (file)
@@ -1429,7 +1429,11 @@ sanitize_cpp_opts (void)
   /* We want -Wno-long-long to override -pedantic -std=non-c99
      and/or -Wtraditional, whatever the ordering.  */
   cpp_opts->warn_long_long
-    = warn_long_long && ((!flag_isoc99 && pedantic) || warn_traditional);
+    = warn_long_long && ((pedantic
+                         && (c_dialect_cxx ()
+                             ? cxx_dialect == cxx98
+                             : !flag_isoc99))
+                         || warn_traditional);
 
   /* Similarly with -Wno-variadic-macros.  No check for c99 here, since
      this also turns off warnings about GCCs extension.  */
index a67b941..cc99369 100644 (file)
@@ -1,3 +1,9 @@
+2008-01-01  Douglas Gregor  <doug.gregor@gmail.com>
+
+       * parser.c (cp_parser_check_decl_spec): Don't warn about "long
+       long" in C++0x mode; change the warning to note that "long long"
+       is only unsupported in C++98 mode.
+
 2007-12-20  Jason Merrill  <jason@redhat.com>
 
        PR c++/34111
index d592620..16f5a4e 100644 (file)
@@ -2147,8 +2147,9 @@ cp_parser_check_decl_spec (cp_decl_specifier_seq *decl_specs)
        {
          if (count > 2)
            error ("%<long long long%> is too long for GCC");
-         else if (pedantic && !in_system_header && warn_long_long)
-           pedwarn ("ISO C++ does not support %<long long%>");
+         else if (pedantic && !in_system_header && warn_long_long
+                   && cxx_dialect == cxx98)
+           pedwarn ("ISO C++ 1998 does not support %<long long%>");
        }
       else if (count > 1)
        {
index 76e5a14..f8ea8d2 100644 (file)
@@ -1,3 +1,7 @@
+2008-01-01  Douglas Gregor  <doug.gregor@gmail.com>
+
+       * g++.dg/cpp0x/long_long.C: New.
+
 2008-01-01  Andrew Pinski  <andrew_pinski@playstation.sony.com>
 
        * gcc.target/spu/tag_manager.c : Include stdlib.h.
diff --git a/gcc/testsuite/g++.dg/cpp0x/long_long.C b/gcc/testsuite/g++.dg/cpp0x/long_long.C
new file mode 100644 (file)
index 0000000..3ef710d
--- /dev/null
@@ -0,0 +1,6 @@
+// { dg-options "-std=c++0x -pedantic" }
+
+void foo()
+{
+  long long x = 17;
+}