24 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -std=c++98 -verify %s2 3// A default template-argument shall not be specified in a function4// template declaration or a function template definition5template<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 a11// 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