[Bug c++/106791] New: [12 Regression] Operator Lookup with using namespace
gcc at hazardy dot de
gcc-bugzilla@gcc.gnu.org
Wed Aug 31 12:57:03 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106791
Bug ID: 106791
Summary: [12 Regression] Operator Lookup with using namespace
Product: gcc
Version: 12.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: gcc at hazardy dot de
Target Milestone: ---
My Catch Testprojects fail with GCC 12, some in a namespace provided
equality-operators which are brought into the gobal namespace with "using
namespace" are not found anymore.
I have narrowed down to: https://godbolt.org/z/GqnvYMGYq
I was not able to narrow it down without using Catch.
If you define WorkAround it compiles with GCC 11 and 12.
#include <catch.hpp>
struct Type1 {};
struct Type2 {};
namespace Op {
bool operator==(const Type1&, const Type2&);
}
//#define WorkAround
#ifndef WorkAround
using namespace Op;
#else
bool operator==(const Type1& t1, const Type2& t2) {
return Op::operator==(t1, t2);
}
#endif
TEST_CASE("") {
Type1 t1;
Type2 t2;
CHECK(t1 == t2);
}
More information about the Gcc-bugs
mailing list