blob: 2a3e422ac7afd3ee2a439f314f14e2688ad64254 [file] [log] [blame]
Richard Smithab91ef12012-07-08 02:38:24 +00001// RUN: %clang_cc1 -std=c++11 -verify %s -ftemplate-depth 2
2
3// PR9793
4template<typename T> auto f(T t) -> decltype(f(t)); // \
5// expected-error {{recursive template instantiation exceeded maximum depth of 2}} \
Stephen Hines651f13c2014-04-23 16:59:28 -07006// expected-note 2 {{while substituting}}
Richard Smithab91ef12012-07-08 02:38:24 +00007
Richard Smith5d99a252012-09-22 00:53:56 +00008struct S {};
Stephen Hines651f13c2014-04-23 16:59:28 -07009int k = f(S{}); // expected-note {{while substituting}}