template <class a> class A {}; template <class b> class B {}; A<B<void()> > x; If you leave out the space between the two >'s at the definition of x, it fails to compile. As far as I'm aware this should work in C++0x mode. The compiler was run with -std=c++0x. candy@blackbox:~/atlantisos/kernel$ g++ -v Using built-in specs. Target: i686-pc-linux-gnu Configured with: ./configure --enable-languages=c,c++ Thread model: posix gcc version 4.3.1 (GCC) candy@blackbox:~/atlantisos/kernel$ uname -a Linux blackbox 2.6.17.13 #12 SMP PREEMPT Fri Jun 22 23:13:07 CEST 2007 i686 Intel(R) Pentium(R) D CPU 2.66GHz GenuineIntel GNU/Linux
Really this is why think C++0x was wrong in thinking that >> can be used as "> >" in the template context :).
Subject: Bug 36460 Author: hutchinsonandy Date: Wed Jun 18 21:48:50 2008 New Revision: 136919 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=136919 Log: PR c/36460 * gcc.dg/utf32-1.c: Mark xfail for AVR target. * gcc.dg/utf32-2.c: Ditto. * gcc.dg/utf32-3.c: Ditto. Modified: trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.dg/utf32-1.c trunk/gcc/testsuite/gcc.dg/utf32-2.c trunk/gcc/testsuite/gcc.dg/utf32-3.c
Could anybody at least confirm this bug?
Let's ask Doug... (by the way, Doug very kindly contributed these C++0x bits on a voluntary basis. As a matter of courtesy, I would suggest avoiding words like "at least". Thanks.)
Patch here: http://gcc.gnu.org/ml/gcc-patches/2008-08/msg00382.html
Subject: Bug 36460 Author: dgregor Date: Wed Aug 6 19:08:12 2008 New Revision: 138819 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=138819 Log: 2008-08-06 Douglas Gregor <doug.gregor@gmail.com> PR c++/36460 * parser.c (cp_parser_template_argument): Don't assume that '>>' following a type-id is an error when in C++0x mode. 2008-08-06 Douglas Gregor <doug.gregor@gmail.com> PR c++/36460 * g++.dg/cpp0x/bracket3.C: Add another test case for the >> warning under -Wc++0x-compat. * g++.dg/cpp0x/bracket4.C: Add testcase for PR c++/36460. Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/parser.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/g++.dg/cpp0x/bracket3.C trunk/gcc/testsuite/g++.dg/cpp0x/bracket4.C
Fixed on the trunk.
*** Bug 35497 has been marked as a duplicate of this bug. ***
(In reply to Andy Hutchinson from comment #2) > Subject: Bug 36460 > > Author: hutchinsonandy > Date: Wed Jun 18 21:48:50 2008 > New Revision: 136919 > > URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=136919 > Log: > PR c/36460 That was meant to be PR 36470 > * gcc.dg/utf32-1.c: Mark xfail for AVR target. > * gcc.dg/utf32-2.c: Ditto. > * gcc.dg/utf32-3.c: Ditto. > > Modified: > trunk/gcc/testsuite/ChangeLog > trunk/gcc/testsuite/gcc.dg/utf32-1.c > trunk/gcc/testsuite/gcc.dg/utf32-2.c > trunk/gcc/testsuite/gcc.dg/utf32-3.c