mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 13:26:09 +00:00

During template instantiation, the instantiator will enter constant evaluated context before instantiate a template argument originated from an expression, and this impedes the instantiator from creating lambdas with independent types. This patch solves the problem via widening the condition that the instantiator marks lambdas as never dependent, and fixes the issue #57960 Differential Revision: https://reviews.llvm.org/D140554
15 lines
317 B
C++
15 lines
317 B
C++
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -std=c++20 %s -emit-llvm -o - | FileCheck %s
|
|
|
|
// CHECK-LABEL: define linkonce_odr void @"_ZN10Issue579601EIiEENS_1FILNS_3$_0EEEEv"()
|
|
namespace Issue57960 {
|
|
template<auto>
|
|
class F {};
|
|
|
|
template<typename D>
|
|
F<[]{}> E() {
|
|
return {};
|
|
}
|
|
|
|
static auto f = E<int>();
|
|
}
|