[Bug c++/105999] New: Wrong requires result inside lambda in a class
egor.pugin at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Jun 16 12:18:43 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105999
Bug ID: 105999
Summary: Wrong requires result inside lambda in a class
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: egor.pugin at gmail dot com
Target Milestone: ---
Gives x instead of y on any latest compiler.
https://godbolt.org/z/6MrvMaPoK
#include <stdio.h>
struct A {
void g(){}
void f() {
[]() {
//if constexpr (requires {this->g();}) {
if constexpr (requires {g();}) {
printf("x");
//g(); // cant call here
} else {
printf("y");
}
}();
}
};
int main() {
A{}.f();
}
More information about the Gcc-bugs
mailing list