我的理论是gcc有一个bug。使用别名参考匿名结构会导致错误
using type = const struct {}&;
但现在当我将其更改为右值引用它铿锵编译,但不能用gcc:在这两个铛和gcc以下编译
using type = const struct {}&&;
// main.cpp:8:17: error: expected ';' after struct definition
// typedef struct {}&& type;
// ^
// main.cpp:8:17: error: missing type-name in typedef-declaration
// main.cpp:8:22: error: expected constructor, destructor, or type conversion before ';' token
// typedef const struct {}&& type;
// ^
它无法与typedef
版本,以及与同样的错误:
typedef const struct {}&& type;
为什么这不能在gcc编译?这是标准问题还是错误?