3 // RUN: split-file %s %t
5 // RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/var_def.cppm -o %t/var_def.pcm
6 // RUN: %clang_cc1 -std=c++20 -emit-module-interface -fprebuilt-module-path=%t %t/reexport1.cppm -o %t/reexport1.pcm
7 // RUN: %clang_cc1 -std=c++20 -emit-module-interface -fprebuilt-module-path=%t %t/reexport2.cppm -o %t/reexport2.pcm
8 // RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/use.cppm -fsyntax-only -verify
10 // RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface %t/var_def.cppm -o %t/var_def.pcm
11 // RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface -fprebuilt-module-path=%t %t/reexport1.cppm -o %t/reexport1.pcm
12 // RUN: %clang_cc1 -std=c++20 -emit-reduced-module-interface -fprebuilt-module-path=%t %t/reexport2.cppm -o %t/reexport2.pcm
13 // RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/use.cppm -fsyntax-only -verify
20 auto bar = zero<int*>;
23 template <class T> constexpr T zero = 0; // expected-error-re {{declaration{{.*}}in the global module follows declaration in module var_def}}
24 // expected-note@* {{previous}}
25 template <> constexpr Int zero<Int> = {0}; // expected-error-re {{declaration{{.*}}in the global module follows declaration in module var_def}}
26 // expected-note@* {{previous}}
27 template <class T> constexpr T* zero<T*> = nullptr; // expected-error-re {{declaration{{.*}}in the global module follows declaration in module var_def}}
28 // expected-note@* {{previous}}
30 template <> constexpr int** zero<int**> = nullptr; // ok, new specialization.
31 template <class T> constexpr T** zero<T**> = nullptr; // ok, new partial specilization.
34 export module var_def;
36 export template <class T> constexpr T zero = 0;
40 export template <> constexpr Int zero<Int> = {0};
41 export template <class T> constexpr T* zero<T*> = nullptr;
44 export module reexport1;
45 export import var_def;
48 export module reexport2;
49 export import var_def;