// RUN: %clang_cc1 -std=c++11 -verify %s
;
A<int> a;
A<int>::E a0 = A<int>.v;
int n = A<int>::E::e1; // expected-error {{implicit instantiation of undefined member}}
; // expected-note 2 {{declared here}}
// FIXME: Now that A<T>::E is defined, we are supposed to inject its enumerators
// into the already-instantiated class A<T>. This seems like a really bad idea,
// though, so we don't implement that, but what we do implement is inconsistent.
//
// Either do as the standard says, or only include enumerators lexically defined
// within the class in its scope.
A<int>::E a1 = A<int>::e1; // expected-error {{no member named 'e1' in 'A<int>'; did you mean simply 'e1'?}}
A<char>::E a2 = A<char>::e2;
typename A<T>::E
A<short>::E a3 = A<short>.;
;
B<int> b;
B<int>::E b0 = B<int>.v;
;
B<int>::E b1 = B<int>::E::e1;
B<char>::E b2 = B<char>::E::e2;
typename B<T>::E
B<short>::E b3 = B<short>.;
// Enumeration members of class templates can be explicitly specialized. For
// unscoped enumerations, specializations must be defined before the primary
// template is, since otherwise the primary template will be implicitly
// instantiated when we parse the nested name specifier.
; // expected-error {{explicit specialization of 'E' after instantiation}} expected-note {{first required here}}
;
B<long long>::E b4 = B<long long>::E::e4;
B<long>::E b5;
;
void
B<long>::E b6 = B<long>::E::e5;
;
;
C<long long>::E c0 = C<long long>::E::e3;
C<long>::E c1;
;
void
C<long>::E c2 = C<long>::E::e5;
;
;
C<int>::E c3 = C<int>::E::e6;
C<int>::E c4 = C<int>::E::e0; // expected-error {{no member named 'e0' in 'C<int>::E'}}
// Enumeration members can't be partially-specialized.
; // expected-error {{nested name specifier for a declaration cannot depend on a template parameter}}
// Explicit specializations can be forward-declared.
;
;
D<int>::E d1 = D<int>::E::e1; // expected-error {{incomplete type 'D<int>::E'}}
;
D<int>::E d2 = D<int>::E::e2;
D<char>::E d3 = D<char>::E::e1; // expected-note {{first required here}}
D<char>::E d4 = D<char>::E::e2; // expected-error {{no member named 'e2' in 'D<char>::E'; did you mean simply 'e2'?}}
; // expected-error {{explicit specialization of 'E' after instantiation}}
;
;
;
;
;
;
;