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