p8-1y.cpp revision ecbce69e354c77bf2d359111bad0c77c516e16f0
1// RUN: %clang_cc1 -std=c++1y -fsyntax-only -verify %s
2
3// -- The argument list of the specialization shall not be identical
4//    to the implicit argument list of the primary template.
5
6template<typename T, int N, template<typename> class X> int v1;
7template<typename T, int N, template<typename> class X> int v1<T, N, X>;
8// expected-error@-1{{variable template partial specialization does not specialize any template argument; to define the primary template, remove the template argument list}}
9
10template<typename...T> int v2;
11template<typename...T> int v2<T...>;
12// expected-error@-1{{variable template partial specialization does not specialize any template argument; to define the primary template, remove the template argument list}}
13
14template<int...N> int v3;
15template<int...N> int v3<N...>;
16// expected-error@-1{{variable template partial specialization does not specialize any template argument; to define the primary template, remove the template argument list}}
17
18template<template<typename> class...X> int v4;
19template<template<typename> class...X> int v4<X...>;
20// expected-error@-1{{variable template partial specialization does not specialize any template argument; to define the primary template, remove the template argument list}}
21
22template<typename Outer> struct X {
23  template<typename Inner> static int y;
24  template<typename Inner> static int y<Outer>; // expected-warning {{can not be deduced}} expected-note {{'Inner'}}
25  template<typename Inner> static int y<Inner>; // expected-error {{does not specialize}}
26};
27template<typename Outer> template<typename Inner> int X<Outer>::y<Outer>; // expected-warning {{can not be deduced}} expected-note {{'Inner'}}
28template<typename Outer> template<typename Inner> int X<Outer>::y<Inner>; // expected-error {{does not specialize}}
29template<> template<typename Inner> int X<int>::y<Inner>; // expected-error {{does not specialize}}
30