26 lines · cpp
1// RUN: rm -rf %t2// RUN: mkdir -p %t3// RUN: split-file %s %t4//5// RUN: %clang_cc1 -std=c++20 %t/template_default_arg.cppm -emit-module-interface -o %t/template_default_arg.pcm6// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only -verify7 8// RUN: %clang_cc1 -std=c++20 %t/template_default_arg.cppm -emit-reduced-module-interface -o %t/template_default_arg.pcm9// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only -verify10//11//--- template_default_arg.cppm12export module template_default_arg;13struct t {};14 15export template <typename T = t>16struct A {17 T a;18};19 20//--- Use.cpp21import template_default_arg;22void bar() {23 A<> a0;24 A<t> a1; // expected-error {{use of undeclared identifier 't'}}25}26