[Bug c++/72682] Redundant concept diagnostics when the same concept is checked multiple times

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Oct 10 10:37:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72682

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Seems to be fixed on trunk:

72682.cc: In function 'int main()':
72682.cc:14:16: error: cannot call function 'void f(T) [with T = S]'
   14 | int main(){ f(s); }
      |                ^
72682.cc:11:44: note: constraints not satisfied
   11 | template<typename T> requires B<T, T> void f(T){}
      |                                            ^
72682.cc: In function 'void f(T) [with T = S]':
72682.cc:3:14:   required for the satisfaction of 'A<S>'
72682.cc:5:14:   required for the satisfaction of 'B<S, S>'
72682.cc:3:18:   in requirements with 'S a'
72682.cc:3:35: note: the required expression '(a == a)' is invalid
    3 | concept bool A = requires(T a) { a==a; };
      |                                  ~^~~


More information about the Gcc-bugs mailing list