[英]GCC fails to compile variadic member concept template on a variadic concept template class
想象一下,我有一個帶有可變參數概念模板成員的可變參數概念模板類。
#include <type_traits>
template<typename T>
concept Arithmetic = std::is_arithmetic_v<T>;
template<Arithmetic... Scalars>
class Foo
{
public:
template<Arithmetic... OtherScalars>
Foo(OtherScalars&&... args)
{
}
};
上面的代碼無法使用GCC (trunk)
進行編譯,但是可以使用Clang (experimental concepts)
傳遞。
GCC編譯器輸出
source>: In instantiation of 'class Foo<int, float, double>':
<source>:20:33: required from here
<source>:11:5: internal compiler error: in tsubst_constraint, at cp/constraint.cc:1949
11 | Foo(OtherScalars&&... args)
| ^~~
Please submit a full bug report, with preprocessed source if appropriate. See <https://gcc.gnu.org/bugs/> for instructions.
ASM generation compiler returned: 1
這是GCC
的錯誤,還是我在這里做錯了?
是的,這是一個錯誤。 輸出從字面上說是這樣,並要求您報告錯誤報告。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.