blob: 06795f9514d38f5e00e9f2e057ea6664edaf8a5a [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}} \
Richard Smith5d99a252012-09-22 00:53:56 +00006// expected-note 3 {{while substituting}}
Richard Smithab91ef12012-07-08 02:38:24 +00007
Richard Smith5d99a252012-09-22 00:53:56 +00008struct S {};
9int k = f(S{});