1 // RUN: %clang_cc1 -fsyntax-only -verify %s
5 template<class T
> T
g(T x
= &p
) { return x
; }
6 template int g
<int>(int); // OK even though &p isn't an int.
9 // Don't impose access restrictions on explicit instantiations.
14 typedef Private Public
;
17 template <class T
> class Temp
{
18 static Temp
<A::Public
> make() { return Temp
<A::Public
>(); }
20 template class Temp
<A::Private
>;
22 // FIXME: this ought to be an error, but it isn't because Sema is
23 // silently failing to create a declaration for the explicit
25 template class Temp
<A::Private
> Temp
<int>::make();
28 // Don't impose access restrictions on explicit specializations,
29 // either. This goes here because it's an extension of the rule for
30 // explicit instantiations and doesn't have any independent support.
33 class Private
{}; // expected-note {{implicitly declared private here}}
35 typedef Private Public
;
38 template <class T
> class Temp
{
39 static Temp
<A::Public
> make();
41 template <> class Temp
<A::Private
> {
46 template <> class Temp
<A::Private
> Temp
<int>::make() {
47 return Temp
<A::Public
>(0);
52 static Temp
<A::Private
> make() { // expected-error {{is a private member}}
53 return Temp
<A::Public
>(0);