25 lines · cpp
1// RUN: %clang_cc1 %s -O0 -disable-llvm-passes -triple=x86_64 -std=c++20 -emit-llvm -o - | FileCheck %s2 3namespace GH161029_regression1 {4 template <class _Fp> auto f(int) { _Fp{}(0); }5 template <class _Fp, int... _Js> void g() {6 (..., f<_Fp>(_Js));7 }8 enum E { k };9 template <int, E> struct ElementAt;10 template <E First> struct ElementAt<0, First> {11 static int value;12 };13 template <typename T, T Item> struct TagSet {14 template <int Index> using Tag = ElementAt<Index, Item>;15 };16 template <typename TagSet> struct S {17 void U() { (void)TagSet::template Tag<0>::value; }18 };19 S<TagSet<E, k>> s;20 void h() {21 g<decltype([](auto) -> void { s.U(); }), 0>();22 }23 // CHECK: call void @_ZN20GH161029_regression11SINS_6TagSetINS_1EELS2_0EEEE1UEv24}25