[Bug c++/79682] [concepts] ambiguous overload with functionally equivalent predicate constraints compiles

2023-03-08 Thread ed at catmur dot uk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79682

Ed Catmur  changed:

   What|Removed |Added

 CC||ed at catmur dot uk

--- Comment #2 from Ed Catmur  ---
I think this was made IFNDR by CWG2603?

[Bug c++/79682] [concepts] ambiguous overload with functionally equivalent predicate constraints compiles

2019-10-29 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79682

Jonathan Wakely  changed:

   What|Removed |Added

  Known to work||10.0
 Blocks||67491

--- Comment #1 from Jonathan Wakely  ---
With this updated testcase using C++2a syntax:

template 
requires ((N & 0x1) != 0) && (N > 1)
int foo() { return 0; }

template 
requires ((N & 0x1) != 0x0)
void foo() { }

int main(void) {
  return foo<0x03>();
}

Current trunk prints:

b.cc: In function 'int main()':
b.cc:10:20: error: call of overloaded 'foo<3>()' is ambiguous
   10 |   return foo<0x03>();
  |^
b.cc:3:5: note: candidate: 'int foo() [with unsigned int N = 3]'
3 | int foo() { return 0; }
  | ^~~
b.cc:7:6: note: candidate: 'void foo() [with unsigned int N = 3]'
7 | void foo() { }
  |  ^~~


So it seems to be fixed. We might want to add the testcase to the testsuite
before closing the bug though.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67491
[Bug 67491] [meta-bug] concepts issues