]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/116481 - avoid building function_type[]
authorRichard Biener <rguenther@suse.de>
Sun, 13 Oct 2024 09:42:27 +0000 (11:42 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 4 Apr 2025 10:10:39 +0000 (12:10 +0200)
commitf1989b50a9141b5bf62275d92b2fa28e9d82ca8b
tree3e187714ba521fa8e511245953cd556bcd9b81f9
parentc62cbe7164765e03a7bc41377452b80b6237d93d
tree-optimization/116481 - avoid building function_type[]

The following avoids building an array type with function or method
element type during diagnosing an array bound violation as this
will result in an error, rejecting a program with a not too useful
error message.  Instead build such array type manually.

PR tree-optimization/116481
* pointer-query.cc (build_printable_array_type):
Build an array types with function or method element type
manually to avoid bogus diagnostic.

* gcc.dg/pr116481.c: New testcase.

(cherry picked from commit 1506027347776a2f6ec5b92d56ef192e85944e2e)
gcc/pointer-query.cc
gcc/testsuite/gcc.dg/pr116481.c [new file with mode: 0644]