14967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar// RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify %s
2588a51a471b4cb23613e8183e05d2d193d2ab813David Majnemer
3588a51a471b4cb23613e8183e05d2d193d2ab813David Majnemertemplate <typename>
4588a51a471b4cb23613e8183e05d2d193d2ab813David Majnemervoid quux();
5588a51a471b4cb23613e8183e05d2d193d2ab813David Majnemer
6588a51a471b4cb23613e8183e05d2d193d2ab813David Majnemervoid fun() {
7588a51a471b4cb23613e8183e05d2d193d2ab813David Majnemer  struct foo {
8588a51a471b4cb23613e8183e05d2d193d2ab813David Majnemer    template <typename> struct bar {};  // expected-error{{templates cannot be declared inside of a local class}}
9588a51a471b4cb23613e8183e05d2d193d2ab813David Majnemer    template <typename> void baz() {}   // expected-error{{templates cannot be declared inside of a local class}}
10588a51a471b4cb23613e8183e05d2d193d2ab813David Majnemer    template <typename> void qux();     // expected-error{{templates cannot be declared inside of a local class}}
114967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar    template <typename> using corge = int; // expected-error{{templates cannot be declared inside of a local class}}
124967a710c84587c654b56c828382219c3937dacbPirama Arumuga Nainar    template <typename T> static T grault; // expected-error{{static data member}} expected-error{{templates cannot be declared inside of a local class}}
13588a51a471b4cb23613e8183e05d2d193d2ab813David Majnemer  };
14588a51a471b4cb23613e8183e05d2d193d2ab813David Majnemer}
15