aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/c-opts.c6
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/parser.c5
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/long_long.C6
6 files changed, 29 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ce2f258..7fc21c4d6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/c-opts.c b/gcc/c-opts.c
index a5c2270..3c62192 100644
--- a/gcc/c-opts.c
+++ b/gcc/c-opts.c
@@ -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. */
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a67b941..cc99369 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index d592620..16f5a4e 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -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)
{
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 76e5a14..f8ea8d2 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..3ef710d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/long_long.C
@@ -0,0 +1,6 @@
+// { dg-options "-std=c++0x -pedantic" }
+
+void foo()
+{
+ long long x = 17;
+}