15 lines · cpp
1// RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify %s2 3template <typename>4void quux();5 6void fun() {7 struct foo {8 template <typename> struct bar {}; // expected-error{{templates cannot be declared inside of a local class}}9 template <typename> void baz() {} // expected-error{{templates cannot be declared inside of a local class}}10 template <typename> void qux(); // expected-error{{templates cannot be declared inside of a local class}}11 template <typename> using corge = int; // expected-error{{templates cannot be declared inside of a local class}}12 template <typename T> static T grault; // expected-error{{templates cannot be declared inside of a local class}}13 };14}15