[Bug c++/95564] New: GCC rejects lambda expression with "noexcept(1+1)"
haoxintu at gmail dot com
gcc-bugzilla@gcc.gnu.org
Sat Jun 6 16:18:58 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95564
Bug ID: 95564
Summary: GCC rejects lambda expression with "noexcept(1+1)"
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: haoxintu at gmail dot com
Target Milestone: ---
This code test.cc
int main(){
auto a = [ & ] (...) noexcept(1+1) {};
return 0;
}
$g++-trunk test.cc
test.cc:2:38: error: narrowing conversion of '2' from 'int' to 'bool'
[-Wnarrowing]
2 | auto a = [ & ] (...) noexcept(1+1) {};
|
GCC fails to compile it, while clang, icc, or msvc accept it.
More information about the Gcc-bugs
mailing list