alexfh wrote:

@zyn0217 @cor3ntin should this case still work? I have troubles finding the 
relevant wording in the Standard. GCC and and Clang before this change used to 
accept this, MSVC fails similarly to Clang after this change 
(https://gcc.godbolt.org/z/Y79W533T3)

```
template <typename T>
concept HasSizeC = requires(T t) { t.size(); };
struct Builder {
  class C {
    friend Builder;
    void size();
  };
  template <HasSizeC F>
  void g(F);
  void f() { g(C{}); }
};
```

```
<source>:10:14: error: no matching member function for call to 'g'
   10 |   void f() { g(C{}); }
      |              ^
<source>:9:8: note: candidate template ignored: constraints not satisfied [with 
F = C]
    9 |   void g(F);
      |        ^
<source>:8:13: note: because 'Builder::C' does not satisfy 'HasSizeC'
    8 |   template <HasSizeC F>
      |             ^
<source>:2:38: note: because 't.size()' would be invalid: 'size' is a private 
member of 'Builder::C'
    2 | concept HasSizeC = requires(T t) { t.size(); };
      |                                      ^
```

https://github.com/llvm/llvm-project/pull/143096
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to