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