tket icon indicating copy to clipboard operation
tket copied to clipboard

Ambiguous overload error in G++13

Open jake-arkinstall opened this issue 1 year ago • 0 comments

GCC13 reports tket/test/Graph/test_ArticulationPoints.cpp:148 to be ambiguous. Clang and GCC12 do not, but I believe GCC13 is is following the (counter-intuitive) guidance of CWG1228 on this one.

The line in question:

  Architecture arc({{0, 1}, {1, 2}, {2, 3}});

Here's a MWE that covers the general problem: https://godbolt.org/z/fbfGc8cMd

More frustrating: Removing the Architecture(const std::vector<std::pair<unsigned, unsigned>>) constructor does not help. GCC13 now complains that the remaining constructors cannot be used as Node isn't explicitly written. GCC12 concurs.

So it's considered a valid overload, thus ambiguous, but is determined to be ill formed if chosen.

At a glance, this problem appears to have an associated defect report, though it is still open. If accepted, this could encourage GCC13 to fall back in line with other implementations.

As such I do not believe there is an effective way of resolving this within Tket without cluttering up the interface, but this issue serves as a reminder to keep track of the issue.

jake-arkinstall avatar Jan 17 '24 12:01 jake-arkinstall