Kae*_*Rin 5 c++ gcc compiler-bug constexpr c++17
template <typename T>
inline constexpr int a = 1;
static_assert(&a<void>, "");
Run Code Online (Sandbox Code Playgroud)
这不会在gcc 9.2上进行编译,但是会在clang和msvc上进行编译。
Gcc抱怨用于的表达式static_assert不是常量表达式。
The code compiles after removing template, removing inline, or removing address-of operator.
Is this a gcc bug?
| 归档时间: |
|
| 查看次数: |
48 次 |
| 最近记录: |