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

            Bug ID: 59352
           Summary: Internal compiler error
           Product: gcc
           Version: 4.7.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vinnie.falco at gmail dot com

Created attachment 31337
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31337&action=edit
Sample code that shows both the line that crashes the compiler and a
work-around.

A function local variable is initialized using constructor syntax from a
template function call. The result is that the compiler crashes with an
internal error.

However, if the same local variable is constructed using assignment syntax, the
internal error disappears. I have a working code sample with no external
dependencies.

Here is the line that crashes:

  std::size_t const id (BasicInterface::type_id <Derived> ());

Changing to the following resolves the issue:

  std::size_t const id = BasicInterface::type_id <Derived> ();

The only difference is that one uses constructor syntax, and the other uses
assignment syntax.

This problem happens both in gcc 4.7.3 and also gcc 4.8.1

Tested under Ubunty 12.04

Reply via email to