view clang/test/SemaTemplate/temp_arg_enum_printing.cpp @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children c4bab56944e8
line wrap: on
line source

// RUN: %clang_cc1 -fsyntax-only -ast-print %s | FileCheck %s

namespace NamedEnumNS
{
  
enum NamedEnum
{
  Val0,
  Val1
};
  
template <NamedEnum E>
void foo();
  
void test() {
  // CHECK: template<> void foo<NamedEnumNS::Val0>()
  NamedEnumNS::foo<Val0>();
  // CHECK: template<> void foo<NamedEnumNS::Val1>()
  NamedEnumNS::foo<(NamedEnum)1>();
  // CHECK: template<> void foo<(NamedEnumNS::NamedEnum)2>()
  NamedEnumNS::foo<(NamedEnum)2>();
}
  
} // NamedEnumNS