1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
3 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
5 // A type-parameter defines its identifier to be a type-name (if
6 // declared with class or typename) or template-name (if declared with
7 // template) in the scope of the template declaration.
8 template<typename T
> struct X0
{
12 template<template<class T
> class Y
> struct X1
{
16 // [Note: because of the name lookup rules, a template-parameter that
17 // could be interpreted as either a non-type template-parameter or a
18 // type-parameter (because its identifier is the name of an already
19 // existing class) is taken as a type-parameter. For example,
20 class T
{ /* ... */ }; // expected-note{{candidate constructor (the implicit copy constructor) not viable}}
21 #if __cplusplus >= 201103L // C++11 or later
22 // expected-note@-2 {{candidate constructor (the implicit move constructor) not viable}}
27 template<class T
, T i
> struct X2
{
30 T t1
= i
; // template-parameters T and i
31 ::T t2
= ::i
; // global namespace members T and i \
32 // expected-error{{no viable conversion}}
37 namespace NA
{ struct S
; }
38 namespace NB
{ struct S
; }
43 template <typename S
> void foo();
44 template <int S
> void bar();
45 template <template<typename
> class S
> void baz();