mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-18 19:16:43 +00:00
[clang][bytecode] Fix discarding block expressions (#112185)
This commit is contained in:
parent
f3947aaa37
commit
4c78c8cc21
@ -3416,6 +3416,9 @@ bool Compiler<Emitter>::VisitCXXDeleteExpr(const CXXDeleteExpr *E) {
|
||||
|
||||
template <class Emitter>
|
||||
bool Compiler<Emitter>::VisitBlockExpr(const BlockExpr *E) {
|
||||
if (DiscardResult)
|
||||
return true;
|
||||
|
||||
const Function *Func = nullptr;
|
||||
if (auto F = Compiler<ByteCodeEmitter>(Ctx, P).compileObjCBlock(E))
|
||||
Func = F;
|
||||
|
@ -1,6 +1,9 @@
|
||||
// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin -fsyntax-only -verify -Wno-unused %s
|
||||
// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin -fsyntax-only -verify -Wno-unused %s -frecovery-ast -frecovery-ast-type
|
||||
|
||||
// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin -fsyntax-only -verify -Wno-unused -fexperimental-new-constant-interpreter %s
|
||||
// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin -fsyntax-only -verify -Wno-unused -frecovery-ast -frecovery-ast-type -fexperimental-new-constant-interpreter %s
|
||||
|
||||
template <typename ...Ts>
|
||||
void f() {
|
||||
((^ { Ts t; }), ...);
|
||||
|
Loading…
x
Reference in New Issue
Block a user