2 // RUN: %clang_cc1 -x c++ -I %S/Inputs/redecl-templates %s -verify -std=c++14
3 // RUN: %clang_cc1 -x c++ -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs/redecl-templates %s -verify -std=c++14
4 // expected-no-diagnostics
6 template<int N
> struct A
{};
7 template<int N
> using X
= A
<N
>;
9 template<int N
> constexpr void f() {}
10 template<int N
> constexpr void g() { f
<N
>(); }
12 template<int N
> extern int v
;
13 template<int N
> int &w
= v
<N
>;
17 // Be careful not to mention A here, that'll import the decls from "a.h".
21 // This will implicitly instantiate A<1> if we haven't imported the explicit
22 // specialization declaration from "a.h".
24 // Likewise for f and v.
28 // This is OK: we declared the explicit specialization before we triggered
29 // instantiation of this specialization.
30 template<> struct A
<1> {};
31 template<> constexpr void f
<1>() {}