diff clang/test/SemaTemplate/temp_arg_enum_printing.cpp @ 150:1d019706d866

LLVM10
author anatofuz
date Thu, 13 Feb 2020 15:10:13 +0900
parents
children 2e18cbf3894f
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/clang/test/SemaTemplate/temp_arg_enum_printing.cpp	Thu Feb 13 15:10:13 2020 +0900
@@ -0,0 +1,24 @@
+// 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<2>()
+  NamedEnumNS::foo<(NamedEnum)2>();
+}
+  
+} // NamedEnumNS