[clang] [clang] Fix array types comparison in getCommonSugaredType (PR #131649)

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 17 13:51:03 PDT 2025


================
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -triple x86_64-linux-gnu %s
+
+bool a;
+constexpr const unsigned char c[] = { 5 };
+constexpr const unsigned char d[1] = { 0 };
+auto b = (a ? d : c);
+
+constexpr const unsigned char c1[][1] = {{ 5 }};
+constexpr const unsigned char d1[1][1] = {{ 0 }};
+auto b1 = (a ? d1 : c1);
----------------
mizvekov wrote:

Please move this test to `clang/test/SemaCXX/sugar-common-types.cpp`, adjusting according to the function and style of that file.

Ie we want to make sure the inner sugar is preserved in the output.

https://github.com/llvm/llvm-project/pull/131649


More information about the cfe-commits mailing list