[Bug c++/102470] New: C++20 NTTP causes ICE
iDingDong at outlook dot com
gcc-bugzilla@gcc.gnu.org
Thu Sep 23 12:59:47 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102470
Bug ID: 102470
Summary: C++20 NTTP causes ICE
Product: gcc
Version: 11.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: iDingDong at outlook dot com
Target Milestone: ---
GCC 11.2 reports ICE to the following piece of code:
//---
#include <concepts>
template <typename T> struct A {
A(A<T> const&) = default;
};
template <std::same_as<int> T> struct A<T> {
A(A<T> const&) = default;
};
//---
Compiled with:
> gcc -std=c++20 test.cpp
The error message:
> gcc -std=c++20 test.cpp
> test.cpp: In substitution of 'template<MemAttr attr> using AlignedStorage = std::aligned_storage_t<((const MemAttr)attr).size, ((const MemAttr)attr).align> [with MemAttr attr = memAttrOf<T>]':
> test.cpp:13:75: required from here
> test.cpp:11:73: internal compiler error: Segmentation fault
> 11 | template <MemAttr attr> using AlignedStorage = ::std::aligned_storage_t<attr.size, attr.align>;
> | ^~~~
> libbacktrace could not find executable to open
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <https://gcc.gnu.org/bugs/> for instructions.
More information about the Gcc-bugs
mailing list