// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s namespace GH62361 { template struct B { // expected-note 14{{candidate}} B() // expected-note 7{{not viable}} requires __is_same(T, int); // expected-note 7{{because '__is_same(char, int)' evaluated to false}} }; template struct B : B { using B::B; }; template void g(B); // expected-note {{cannot convert}} void f1() { B b1; B b2{}; B b3 = {}; new B{}; new B(); g({}); B{}; B(); } void f2() { B b1; B b2{}; B b3 = {}; new B{}; new B(); g({}); B{}; B(); } void f3() { B b1; // expected-error {{no matching constructor}} B b2{}; // expected-error {{no matching constructor}} B b3 = {}; // expected-error {{no matching constructor}} new B{}; // expected-error {{no matching constructor}} new B(); // expected-error {{no matching constructor}} g({}); // expected-error {{no matching function}} B{}; // expected-error {{no matching constructor}} B(); // expected-error {{no matching constructor}} } } namespace no_early_substitution { template concept X = true; struct A {}; template struct B { B() requires X; B(); }; template struct C : public B { using B::B; }; void foo() { // OK, we only substitute T ~> V& into X in a SFINAE context, // during satisfaction checks. C(); } } namespace GH62362 { template concept C = true; template struct Test { Test() requires(C); }; struct Bar : public Test { using Test::Test; }; template <> struct Test : public Test { using Test::Test; }; void foo() { Bar(); Test(); } }