summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/temp/temp.decls/temp.mem/p2.cpp
blob: feeb362e34b402759191eda63d5fc0d7fd307972 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify %s

template <typename>
void quux();

void fun() {
  struct foo {
    template <typename> struct bar {};  // expected-error{{templates cannot be declared inside of a local class}}
    template <typename> void baz() {}   // expected-error{{templates cannot be declared inside of a local class}}
    template <typename> void qux();     // expected-error{{templates cannot be declared inside of a local class}}
    template <typename> using corge = int; // expected-error{{templates cannot be declared inside of a local class}}
    template <typename T> static T grault; // expected-error{{static data member}} expected-error{{templates cannot be declared inside of a local class}}
  };
}
OpenPOWER on IntegriCloud