diff mbox

PATCHes to help with C++11 bootstrap

Message ID 554E80EE.600@redhat.com
State New
Headers show

Commit Message

Jason Merrill May 9, 2015, 9:49 p.m. UTC
On 05/09/2015 01:27 PM, Markus Trippelsdorf wrote:
> This also enables the following bogus warning:
>   ~ % g++ -Wall -std=c++11 test.cpp
> test.cpp:3:26: warning: ‘>>’ operator is treated as two right angle brackets in C++11 [-Wc++11-compat]

Fixed thus:
diff mbox

Patch

commit 1c492cd18b2869305cc3ee16f84b6464f98f4e4c
Author: Jason Merrill <jason@redhat.com>
Date:   Sat May 9 16:16:46 2015 -0500

    	* c-opts.c (c_common_post_options): Also clear
    	cpp_opts->cpp_warn_cxx11_compat.

diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
index bd99871..e9eb511 100644
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
@@ -905,6 +905,7 @@  c_common_post_options (const char **pfilename)
       /* If we're allowing C++0x constructs, don't warn about C++98
 	 identifiers which are keywords in C++0x.  */
       warn_cxx11_compat = 0;
+      cpp_opts->cpp_warn_cxx11_compat = 0;
 
       if (warn_narrowing == -1)
 	warn_narrowing = 1;
diff --git a/gcc/testsuite/g++.dg/cpp0x/bracket5.C b/gcc/testsuite/g++.dg/cpp0x/bracket5.C
new file mode 100644
index 0000000..22ac544
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/bracket5.C
@@ -0,0 +1,6 @@ 
+// { dg-options "-Wall" }
+// { dg-do compile { target c++11 } }
+
+template <int> struct X {};
+template <typename> struct Y { static int const c = 0; };
+int main() { return Y<X<1>>::c; }