https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66281
Bug ID: 66281 Summary: [C++14][Variable templates] internal compiler error: in tsubst, at cp/pt.c:12022 Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ldionne.2 at gmail dot com Target Milestone: --- Hi, The following code causes an ICE on GCC trunk (couple of weeks old): ------------------------------------------------------------------------ template <typename ...> auto f() { return 1; } template <char> auto variable_template2 = f(); template <char c> auto variable_template1 = variable_template2<c>; template int variable_template1<'c'>; ------------------------------------------------------------------------ Sample command line (lines trimmed): ------------------------------------------------------------------------ › ~/code/gcc5/bin/g++ --version g++ (GCC) 6.0.0 20150423 (experimental) Copyright (C) 2015 Free Software Foundation, Inc. › ~/code/gcc5/bin/g++ -std=c++1y ~/Desktop/bug.cpp ~/Desktop/bug.cpp: In instantiation of ‘auto variable_template1<'c'>’: ~/Desktop/bug.cpp:9:14: required from here ~/Desktop/bug.cpp:4:6: internal compiler error: in tsubst, at cp/pt.c:11973 auto variable_template2 = f(); ^ ~/Desktop/bug.cpp:4:6: internal compiler error: Abort trap: 6 g++: internal compiler error: Abort trap: 6 (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. ------------------------------------------------------------------------ Regards, Louis Dionne