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: unassig...@gcc.gnu.org
        ReportedBy: b...@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;"

Reply via email to