1*f183848aSPaul Robinson // RUN: %clang_cc1 -fsyntax-only -ast-print %s -std=c++11 | FileCheck %s
2*f183848aSPaul Robinson 
3*f183848aSPaul Robinson // Make sure that for template value arguments that are unscoped enumerators,
4*f183848aSPaul Robinson // no qualified enum information is included in their name, as their visibility
5*f183848aSPaul Robinson // is global. In the case of scoped enumerators, they must include information
6*f183848aSPaul Robinson // about their enum enclosing scope.
7*f183848aSPaul Robinson 
8*f183848aSPaul Robinson enum E1 { e1 };
9*f183848aSPaul Robinson template<E1 v> struct tmpl_1 {};
10*f183848aSPaul Robinson // CHECK: template<> struct tmpl_1<e1>
11*f183848aSPaul Robinson tmpl_1<E1::e1> TMPL_1;                      // Name must be 'e1'.
12*f183848aSPaul Robinson 
13*f183848aSPaul Robinson namespace nsp_1 { enum E2 { e2 }; }
14*f183848aSPaul Robinson template<nsp_1::E2 v> struct tmpl_2 {};
15*f183848aSPaul Robinson // CHECK: template<> struct tmpl_2<nsp_1::e2>
16*f183848aSPaul Robinson tmpl_2<nsp_1::E2::e2> TMPL_2;               // Name must be 'nsp_1::e2'.
17*f183848aSPaul Robinson 
18*f183848aSPaul Robinson enum class E3 { e3 };
19*f183848aSPaul Robinson template<E3 v> struct tmpl_3 {};
20*f183848aSPaul Robinson // CHECK: template<> struct tmpl_3<E3::e3>
21*f183848aSPaul Robinson tmpl_3<E3::e3> TMPL_3;                      // Name must be 'E3::e3'.
22*f183848aSPaul Robinson 
23*f183848aSPaul Robinson namespace nsp_2 { enum class E4 { e4 }; }
24*f183848aSPaul Robinson template<nsp_2::E4 v> struct tmpl_4 {};
25*f183848aSPaul Robinson // CHECK: template<> struct tmpl_4<nsp_2::E4::e4>
26*f183848aSPaul Robinson tmpl_4<nsp_2::E4::e4> TMPL_4;               // Name must be 'nsp_2::E4::e4'.
27