[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaCXX / lookup-template-name-extern-CXX.cpp
blobf851af7ecec26c0c4298a88fac4a60dee587b33a
1 // Tests that the lookup in transparent declaration context
2 // (linkage specifiaction context) wouldn't cause compiler crash.
3 // RUN: %clang_cc1 -std=c++20 %s -fsyntax-only -verify
4 extern "C++" {
5 template <class T>
6 class X {}; // expected-note {{candidate template ignored: couldn't infer template argument 'T'}} \
7 // expected-note {{implicit deduction guide declared as 'template <class T> X(X<T>) -> X<T>'}} \
8 // expected-note {{candidate function template not viable: requires 1 argument, but 0 were provided}} \
9 // expected-note {{implicit deduction guide declared as 'template <class T> X() -> X<T>'}}
12 void foo() {
13 X x; // expected-error {{no viable constructor or deduction guide for deduction of template arguments of 'X'}}