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++/47705] New: internal compiler error: in convert_nontype_argument, at cp/pt.c:5006


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47705

           Summary: internal compiler error: in convert_nontype_argument,
                    at cp/pt.c:5006
           Product: gcc
           Version: 4.5.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: bero@arklinux.org


Running the following (invalid) code:


template<char const * const x> class Something {
};

extern char const xyz;

class SomethingElse:public Something<xyz> {
};


through gcc 4.5.2 results in:


test.cpp:6:41: internal compiler error: in convert_nontype_argument, at
cp/pt.c:5006



The problem with the code is that xyz should be xyz[] -- I'd expect the error
message to be

test.cpp:6:41: error: âxyzâ is not a valid template argument because âxyzâ is a
variable, not the address of a variable

Which is what you get if you remove the "const" in "extern char const xyz;"


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