summaryrefslogtreecommitdiff
path: root/clang/test/CXX/temp/temp.spec/temp.expl.spec/p15.cpp
blob: 72f33df7efa42b48945269a7fbefe4c389bbed31 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// RUN: %clang_cc1 -fsyntax-only -verify %s

struct NonDefaultConstructible {
  NonDefaultConstructible(const NonDefaultConstructible&); // expected-note{{candidate constructor}}
};

template<typename T, typename U>
struct X {
  static T member;
};

template<typename T, typename U>
T X<T, U>::member; // expected-error{{no matching constructor}}

// Okay; this is a declaration, not a definition.
template<>
NonDefaultConstructible X<NonDefaultConstructible, long>::member;

NonDefaultConstructible &test(bool b) {
  return b? X<NonDefaultConstructible, int>::member // expected-note{{instantiation}}
          : X<NonDefaultConstructible, long>::member;
}

namespace rdar9422013 {
  template<int>
  struct X {
    struct Inner {
      static unsigned array[17];
    };
  };

  template<> unsigned X<1>::Inner::array[]; // okay
}