diff --git a/clang/lib/AST/Interp/EvalEmitter.cpp b/clang/lib/AST/Interp/EvalEmitter.cpp index 6715921ff1d97..d90cf1812bb77 100644 --- a/clang/lib/AST/Interp/EvalEmitter.cpp +++ b/clang/lib/AST/Interp/EvalEmitter.cpp @@ -152,7 +152,6 @@ template <> bool EvalEmitter::emitRet(const SourceInfo &Info) { if (!isActive()) return true; // Function pointers cannot be converted to rvalues. - assert(!ConvertResultToRValue); EvalResult.setFunctionPointer(S.Stk.pop()); return true; } diff --git a/clang/test/AST/Interp/comma.cpp b/clang/test/AST/Interp/comma.cpp new file mode 100644 index 0000000000000..795958e90b092 --- /dev/null +++ b/clang/test/AST/Interp/comma.cpp @@ -0,0 +1,10 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify %s -fexperimental-new-constant-interpreter +// expected-no-diagnostics + +// PR6076 +void f(); +void (&g)() = (void(), f); + +int a[1]; +int (&b)[1] = (void(), a);