Bug 36460 - No space between >'s not always handled in C++0x
Summary: No space between >'s not always handled in C++0x
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.3.1
: P3 normal
Target Milestone: 4.4.0
Assignee: dgregor
URL:
Keywords:
: 35497 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-06-07 20:17 UTC by Peter Bindels
Modified: 2019-12-20 22:03 UTC (History)
4 users (show)

See Also:
Host: i486-slackware-linux
Target: i586-pc-elf
Build: i486-slackware-linux
Known to work:
Known to fail:
Last reconfirmed: 2008-08-06 13:48:53


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Bindels 2008-06-07 20:17:05 UTC
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
Comment 1 Andrew Pinski 2008-06-07 20:21:52 UTC
Really this is why  think C++0x was wrong in thinking that >> can be used as "> >" in the template context :).
Comment 2 Andy Hutchinson 2008-06-18 21:49:34 UTC
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

Comment 3 Peter Bindels 2008-08-06 11:44:54 UTC
Could anybody at least confirm this bug?
Comment 4 Paolo Carlini 2008-08-06 12:22:00 UTC
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.) 
Comment 5 dgregor 2008-08-06 14:30:15 UTC
Patch here: http://gcc.gnu.org/ml/gcc-patches/2008-08/msg00382.html
Comment 6 dgregor 2008-08-06 19:09:34 UTC
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

Comment 7 dgregor 2008-08-06 19:12:09 UTC
Fixed on the trunk.
Comment 8 Volker Reichelt 2008-12-29 00:16:57 UTC
*** Bug 35497 has been marked as a duplicate of this bug. ***
Comment 9 Jonathan Wakely 2019-12-20 22:03:54 UTC
(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