From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/CXX/temp/temp.param/p9.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 clang/test/CXX/temp/temp.param/p9.cpp (limited to 'clang/test/CXX/temp/temp.param/p9.cpp') diff --git a/clang/test/CXX/temp/temp.param/p9.cpp b/clang/test/CXX/temp/temp.param/p9.cpp new file mode 100644 index 0000000..b2318c2 --- /dev/null +++ b/clang/test/CXX/temp/temp.param/p9.cpp @@ -0,0 +1,23 @@ +// RUN: %clang_cc1 -fsyntax-only -std=c++98 -verify %s + +// A default template-argument shall not be specified in a function +// template declaration or a function template definition +template // expected-warning{{default template arguments for a function template are a C++11 extension}} + void foo0(T); +template // expected-warning{{default template arguments for a function template are a C++11 extension}} + void foo1(T) { } + +// [...] nor in the template-parameter-list of the definition of a +// member of a class template. +template +struct X0 { + void f(); +}; + +template // expected-error{{cannot add a default template argument}} +void X0::f() { } + +class X1 { + template class TT = X0> // expected-error{{not permitted on a friend template}} + friend void f2(); +}; -- cgit v1.2.3