xref: /llvm-project/clang/test/SemaTemplate/temp_arg_enum_printing.cpp (revision 7c1d9b15eee3a34678addab2bab66f3020ac0753)
1 // RUN: %clang_cc1 -ast-print %s | FileCheck %s
2 
3 namespace NamedEnumNS
4 {
5 
6 enum class NamedEnum
7 {
8   Val0,
9   Val1
10 };
11 
12 template <NamedEnum E>
13 void foo();
14 
test()15 void test() {
16   // CHECK: template<> void foo<NamedEnumNS::NamedEnum::Val0>()
17   NamedEnumNS::foo<NamedEnum::Val0>();
18   // CHECK: template<> void foo<NamedEnumNS::NamedEnum::Val1>()
19   NamedEnumNS::foo<(NamedEnum)1>();
20   // CHECK: template<> void foo<(NamedEnumNS::NamedEnum)2>()
21   NamedEnumNS::foo<(NamedEnum)2>();
22 }
23 
24 } // NamedEnumNS
25