https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119026
Bug ID: 119026
Summary: Problem of const constexpr and maybe gcc 10 accepts
invalid
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: qurong at ios dot ac.cn
Target Milestone: ---
For this program:
template < typename T > const constexpr decltype (auto) b() {
return 0;
}
int main() {
const constexpr decltype (auto) a = b <int>();
return 0;
}
This causes an error in clang、msvc and gcc≥11, but and gcc10 didn't report the
error.
Compiler Explorer link: https://godbolt.org/z/cqM5Pn896