【发布时间】:2020-10-06 13:31:38
【问题描述】:
以下program:
template<typename = void>
const int n;
gcc编译成功,但是clang报错:
# error: default initialization of an object of const type 'const int'
const int n;
^
= 0
这是有道理的。
如果使用n,gcc 确实会报错,但即使n 未使用,是否也需要进行诊断?
【问题讨论】:
标签: c++ language-lawyer uninitialized-constant