instantiation-depth-subst.cpp 325 B

123456789
  1. // RUN: %clang_cc1 -std=c++11 -verify %s -ftemplate-depth 2
  2. // PR9793
  3. template<typename T> auto f(T t) -> decltype(f(t)); // \
  4. // expected-error {{recursive template instantiation exceeded maximum depth of 2}} \
  5. // expected-note 2 {{while substituting}}
  6. struct S {};
  7. int k = f(S{}); // expected-note {{while substituting}}