aboutsummaryrefslogtreecommitdiff
path: root/clang/test/SemaTemplate/instantiation-depth-subst.cpp
blob: 17944bc3aaa4062d24e7809700e551c843b50110 (plain)
1
2
3
4
5
6
7
8
9
10
// RUN: %clang_cc1 -std=c++11 -verify %s -ftemplate-depth=2

// PR9793
template<typename T> auto f(T t) -> decltype(f(t)); // \
// expected-error {{recursive template instantiation exceeded maximum depth of 2}} \
// expected-note 2 {{while substituting}} \
// expected-note {{use -ftemplate-depth=N to increase recursive template instantiation depth}}

struct S {};
int k = f(S{}); // expected-note {{while substituting}}