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
15 auto bar = zero<int*>;
18 template <class T> constexpr T zero = 0; // expected-error-re {{declaration{{.*}}in the global module follows declaration in module var_def}}
19 // expected-note@* {{previous}}
20 template <> constexpr Int zero<Int> = {0}; // expected-error-re {{declaration{{.*}}in the global module follows declaration in module var_def}}
21 // expected-note@* {{previous}}
22 template <class T> constexpr T* zero<T*> = nullptr; // expected-error-re {{declaration{{.*}}in the global module follows declaration in module var_def}}
23 // expected-note@* {{previous}}
25 template <> constexpr int** zero<int**> = nullptr; // ok, new specialization.
26 template <class T> constexpr T** zero<T**> = nullptr; // ok, new partial specilization.
29 export module var_def;
31 export template <class T> constexpr T zero = 0;
35 export template <> constexpr Int zero<Int> = {0};
36 export template <class T> constexpr T* zero<T*> = nullptr;
39 export module reexport1;
40 export import var_def;
43 export module reexport2;
44 export import var_def;