blob: 77143136c3d225287f9cac8f26d501e6812a93b9 [file] [log] [blame]
Richard Smith762bb9d2011-10-13 22:29:44 +00001// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
Douglas Gregor51ffb0c2009-11-25 18:55:14 +00002
3// Test default template arguments for function templates.
4template<typename T = int>
5void f0();
6
7template<typename T>
8void f0();
9
10void g0() {
11 f0(); // okay!
12}
13
14template<typename T, int N = T::value>
15int &f1(T);
16
17float &f1(...);
18
19struct HasValue {
20 static const int value = 17;
21};
22
23void g1() {
24 float &fr = f1(15);
25 int &ir = f1(HasValue());
26}