[Bug c++/99152] New: Wrong type of implicitly captured by-value unevaluated operand
oleksandr.koval.dev at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Feb 18 15:49:41 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99152
Bug ID: 99152
Summary: Wrong type of implicitly captured by-value unevaluated
operand
Product: gcc
Version: 11.0
URL: https://godbolt.org/z/sYsTqa
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: oleksandr.koval.dev at gmail dot com
Target Milestone: ---
This example was taken directly from the
standard(http://eel.is/c++draft/expr.prim.id.unqual#3):
void f() {
float x, &r = x;
auto l = [=] () {
static_assert(std::is_same_v<decltype(x), float>);
static_assert(std::is_same_v<decltype((x)), const float&>);
static_assert(std::is_same_v<decltype(r), float&>);
// fails, decltype((r)) is float&
static_assert(std::is_same_v<decltype((r)), const float&>);
};
}
More information about the Gcc-bugs
mailing list