[Bug c++/82159] New: ICE: in assign_temp, at function.c:961

heinzisoft at web dot de gcc-bugzilla@gcc.gnu.org
Sat Sep 9 13:33:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82159

            Bug ID: 82159
           Summary: ICE: in assign_temp, at function.c:961
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: heinzisoft at web dot de
  Target Milestone: ---

Seeing the following error on GCC 6.3.0 and GCC 7.2.0, while it builds fine on
GCC 5 and on current Clang. OS is Ubuntu 17.10.

Steps to Repro:
-----------------

$ g++ test.cpp
test.cpp: In function ‘int main()’:
test.cpp:17:35: internal compiler error: in assign_temp, at function.c:961
   MyClass<0> taken = data.func<0>();
                                   ^
Please submit a full bug report,
with preprocessed source if appropriate.


Source file test.cpp:
-------------

#include <cstring>

template<size_t SIZE>
struct MyClass {
public:
  ~MyClass() {}

  template<size_t size> MyClass<size> func() {
    return MyClass<size>();
  }

  unsigned char data[SIZE];
};

int main() {
  MyClass<16> data;
  MyClass<0> taken = data.func<0>();
}


More information about the Gcc-bugs mailing list