[Bug c++/56702] New: <: wrongly considered an alternative token for template argument list using global name specifier
mmehlich at semanticdesigns dot com
gcc-bugzilla@gcc.gnu.org
Sat Mar 23 22:48:00 GMT 2013
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)
More information about the Gcc-bugs
mailing list