【发布时间】:2015-05-21 22:35:47
【问题描述】:
我的理论是 gcc 有一个错误。以下在 clang 和 gcc 中编译:
using type = const struct {}&;
但是现在当我将它更改为右值引用时,它会使用 clang 而不是 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 中编译失败?这是标准的问题还是错误?
【问题讨论】:
标签: c++ c++11 gcc using-declaration