This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/56702] New: <: wrongly considered an alternative token for template argument list using global name specifier


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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]