From 1f10cddef587e43c21b4ea260338070f7baa3727 Mon Sep 17 00:00:00 2001 From: Jeroen Ketema Date: Thu, 11 Dec 2025 15:27:16 +0100 Subject: [PATCH] C++: Accept test changes after frontend update and uncomment test case The new frontend version does less constant folding. --- cpp/ql/test/library-tests/constants/addresses/addresses.cpp | 4 +--- .../library-tests/constants/addresses/addresses.expected | 5 +++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cpp/ql/test/library-tests/constants/addresses/addresses.cpp b/cpp/ql/test/library-tests/constants/addresses/addresses.cpp index b15a6324878..13d748771f2 100644 --- a/cpp/ql/test/library-tests/constants/addresses/addresses.cpp +++ b/cpp/ql/test/library-tests/constants/addresses/addresses.cpp @@ -26,9 +26,7 @@ void constantAddresses(int param) { constexpr int *array2d = &int_arr_arr[1][1] + 1; constexpr int *const_ints = &int_arr_arr[int_const][extern_int_const]; - // Commented out because clang and EDG disagree on whether this is - // constant. - //constexpr int *stmtexpr_int = &int_arr[ ({ 1; }) ]; + constexpr int *stmtexpr_int = &int_arr[ ({ 1; }) ]; constexpr int *comma_int = &int_arr[ ((void)0, 1) ]; constexpr int *comma_addr = ((void)0, &int_var); diff --git a/cpp/ql/test/library-tests/constants/addresses/addresses.expected b/cpp/ql/test/library-tests/constants/addresses/addresses.expected index e69de29bb2d..e96a08b0404 100644 --- a/cpp/ql/test/library-tests/constants/addresses/addresses.expected +++ b/cpp/ql/test/library-tests/constants/addresses/addresses.expected @@ -0,0 +1,5 @@ +| addresses.cpp:29:35:29:54 | & ... | stmtexpr_int | misclassified as NOT constant | +| addresses.cpp:31:32:31:55 | & ... | comma_int | misclassified as NOT constant | +| addresses.cpp:36:39:36:70 | ... ? ... : ... | ternary_ptr_cond | misclassified as NOT constant | +| addresses.cpp:37:35:37:69 | & ... | ptr_subtract | misclassified as NOT constant | +| addresses.cpp:39:35:39:50 | ... + ... | constexpr_va | misclassified as NOT constant |