clang/test/SemaTemplate/deferred-concept-inst.cpp
raw| 1 | // RUN: %clang_cc1 -std=c++2a -x c++ %s -verify -fsyntax-only -Wno-unused-value |
| 2 | // expected-no-diagnostics |
| 3 | |
| 4 | namespace GithubBug44178 { |
| 5 | template <typename D> |
| 6 | struct CRTP { |
| 7 | void call_foo() |
| 8 | requires requires(D &v) { v.foo(); } |
| 9 | { |
| 10 | static_cast<D *>(this)->foo(); |
| 11 | } |
| 12 | }; |
| 13 | |
| 14 | struct Test : public CRTP<Test> { |
| 15 | void foo() {} |
| 16 | }; |
| 17 | |
| 18 | int main() { |
| 19 | Test t; |
| 20 | t.call_foo(); |
| 21 | return 0; |
| 22 | } |
| 23 | } // namespace GithubBug44178 |