File: temp_arg_enum_printing_more.cpp

package info (click to toggle)
llvm-toolchain-15 1%3A15.0.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,554,644 kB
  • sloc: cpp: 5,922,452; ansic: 1,012,136; asm: 674,362; python: 191,568; objc: 73,855; f90: 42,327; lisp: 31,913; pascal: 11,973; javascript: 10,144; sh: 9,421; perl: 7,447; ml: 5,527; awk: 3,523; makefile: 2,520; xml: 885; cs: 573; fortran: 567
file content (26 lines) | stat: -rw-r--r-- 1,078 bytes parent folder | download | duplicates (21)
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
// RUN: %clang_cc1 -fsyntax-only -ast-print %s -std=c++11 | FileCheck %s

// Make sure that for template value arguments that are unscoped enumerators,
// no qualified enum information is included in their name, as their visibility
// is global. In the case of scoped enumerators, they must include information
// about their enum enclosing scope.

enum E1 { e1 };
template<E1 v> struct tmpl_1 {};
// CHECK: template<> struct tmpl_1<e1>
tmpl_1<E1::e1> TMPL_1;                      // Name must be 'e1'.

namespace nsp_1 { enum E2 { e2 }; }
template<nsp_1::E2 v> struct tmpl_2 {};
// CHECK: template<> struct tmpl_2<nsp_1::e2>
tmpl_2<nsp_1::E2::e2> TMPL_2;               // Name must be 'nsp_1::e2'.

enum class E3 { e3 };
template<E3 v> struct tmpl_3 {};
// CHECK: template<> struct tmpl_3<E3::e3>
tmpl_3<E3::e3> TMPL_3;                      // Name must be 'E3::e3'.

namespace nsp_2 { enum class E4 { e4 }; }
template<nsp_2::E4 v> struct tmpl_4 {};
// CHECK: template<> struct tmpl_4<nsp_2::E4::e4>
tmpl_4<nsp_2::E4::e4> TMPL_4;               // Name must be 'nsp_2::E4::e4'.