This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/56702] New: <: wrongly considered an alternative token for template argument list using global name specifier
- From: "mmehlich at semanticdesigns dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 23 Mar 2013 22:48:03 +0000
- Subject: [Bug c++/56702] New: <: wrongly considered an alternative token for template argument list using global name specifier
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56702
Bug #: 56702
Summary: <: wrongly considered an alternative token for
template argument list using global name specifier
Classification: Unclassified
Product: gcc
Version: 4.7.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: mmehlich@semanticdesigns.com
According to 2.5, paragraph 3, second item in list the character sequence
'<:' in the following example is not a alternative token/digraph,
but < is a separate token. Thus, this should not cause an error.
(Note: This is different from C++98.)
Example code:
class X { };
template<typename> class Y { };
Y<::X> y;
Command line and gcc 4.7.2 error message:
>>> cp fail.cpp gcc -std=c++11 test.cpp
test.cpp:4:2: error: '<::' cannot begin a template-argument list [-fpermissive]
test.cpp:4:2: note: '<:' is an alternate spelling for '['. Insert whitespace
between '<' and '::'
test.cpp:4:2: note: (if you use '-fpermissive' G++ will accept your code)