This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/86961] New: ICE in finish_member_declaration when an alias template is used
- From: "v.reshetnikov at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 14 Aug 2018 21:26:03 +0000
- Subject: [Bug c++/86961] New: ICE in finish_member_declaration when an alias template is used
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86961
Bug ID: 86961
Summary: ICE in finish_member_declaration when an alias
template is used
Product: gcc
Version: 9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: v.reshetnikov at gmail dot com
Target Milestone: ---
/********************** BEGIN SOURCE **********************/
template<class>
struct Outer {
template<class>
struct Inner;
template<class T>
using Alias = Inner<T>;
};
template<>
template<class T>
struct Outer<bool>::Inner {
static constexpr auto value = sizeof(T);
};
static_assert(Outer<bool>::Inner<bool>::value == sizeof(bool)); // OK
static_assert(Outer<bool>::Alias<bool>::value == sizeof(bool)); // error
/*********************** END SOURCE ***********************/
The first static_assert compiles OK, but the second results in an ICE:
/********************** BEGIN OUTPUT **********************/
<source>: In instantiation of 'struct Outer<bool>::Inner<bool>':
<source>:17:39: required from here
<source>:13:27: internal compiler error: in finish_member_declaration, at
cp/semantics.c:3085
13 | static constexpr auto value = sizeof(T);
| ^~~~~
Compiler returned: 1
/*********************** END OUTPUT ***********************/
This issue was found with build 9.0.0 20180813 (experimental), but appears to
exist in earlier versions as well.
For comparison, Clang compiles this code successfully.