Fix comparison of array types
Currently it's not possible to call functions if an argument is a pointer to an array: ``` (gdb) l f 1 int f (int (*x)[2]) 2 { 3 return x[0][1]; 4 } 5 6 int main() 7 { 8 int a[2][2] = {{0, 1}, {2, 3}}; 9 return f (a); 10 } (gdb) p f(a) Cannot resolve function f to any overloaded instance ``` This happens because types_equal doesn't handle array types, so the function is never even considered as a possibility. With array type handling added, by comparing element types and array bounds, the same works: ``` (gdb) p f(a) $1 = 1 ``` Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=15398 Co-Authored-By:Keith Seitz <keiths@redhat.com> Reviewed-By:
Guinevere Larsen <blarsen@redhat.com> Approved-By:
Tom Tromey <tom@tromey.com>
Loading
Please register or sign in to comment