https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124184
Bug ID: 124184
Summary: CWG 3123 vs. noexcept
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jakub at gcc dot gnu.org
Target Milestone: ---
Barry Revzin mentioned in a private mail
namespace N {
template <class C>
auto begin(C& c) noexcept(noexcept(c.begin()))
-> decltype(c.begin());
template <class C>
auto end(C& c) noexcept(noexcept(c.end()))
-> decltype(c.end());
struct Wrong { };
}
template <class T>
struct Silly {
int x;
struct iterator {
static_assert(!__is_same(T, N::Wrong));
};
auto begin() -> iterator;
};
auto main() -> int {
template for (auto elem : Silly<N::Wrong>()) {
}
}
should pass in -std=c++26 mode but is rejected.