p9.cpp revision b3df1386680b3830d2f4d300d4d7eaba134135fc
1// RUN: %clang_cc1 -fsyntax-only -std=c++98 -verify %s 2 3// A default template-argument shall not be specified in a function 4// template declaration or a function template definition 5template<typename T = int> // expected-warning{{default template arguments for a function template are a C++11 extension}} 6 void foo0(T); 7template<typename T = int> // expected-warning{{default template arguments for a function template are a C++11 extension}} 8 void foo1(T) { } 9 10// [...] nor in the template-parameter-list of the definition of a 11// member of a class template. 12template<int N> 13struct X0 { 14 void f(); 15}; 16 17template<int N = 0> // expected-error{{cannot add a default template argument}} 18void X0<N>::f() { } 19 20class X1 { 21 template<template<int> class TT = X0> // expected-error{{not permitted on a friend template}} 22 friend void f2(); 23}; 24