public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Iain D Sandoe <iains@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-11335] testsuite, objective-c: Fix a testcase on Windows. Date: Mon, 22 Apr 2024 13:10:10 +0000 (GMT) [thread overview] Message-ID: <20240422131010.1A86B3858402@sourceware.org> (raw) https://gcc.gnu.org/g:ce169d2712296b193ecb94768fee1477bb0d0ed0 commit r11-11335-gce169d2712296b193ecb94768fee1477bb0d0ed0 Author: Iain Sandoe <iain@sandoe.co.uk> Date: Wed Feb 15 10:47:51 2023 +0000 testsuite, objective-c: Fix a testcase on Windows. Windows needs to use uintptr_t to represent an integral pointer type (long is not the right type there). Patch from 'nightstike'. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/testsuite/ChangeLog: * obj-c++.dg/proto-lossage-4.mm: Use uintptr_t for integral pointer representations. (cherry picked from commit 142bd88c5f609546a466743ab1066d5620a830bc) Diff: --- gcc/testsuite/obj-c++.dg/proto-lossage-4.mm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gcc/testsuite/obj-c++.dg/proto-lossage-4.mm b/gcc/testsuite/obj-c++.dg/proto-lossage-4.mm index 2e753d1f8ba..ff053bec7d0 100644 --- a/gcc/testsuite/obj-c++.dg/proto-lossage-4.mm +++ b/gcc/testsuite/obj-c++.dg/proto-lossage-4.mm @@ -6,24 +6,26 @@ /* One-line substitute for objc/objc.h */ typedef struct objc_object { struct objc_class *class_pointer; } *id; +typedef __UINTPTR_TYPE__ uintptr_t; + @protocol Proto -- (long)someValue; +- (uintptr_t)someValue; @end @interface Obj -- (long)anotherValue; +- (uintptr_t)anotherValue; @end -long foo(void) { - long receiver = 2; +uintptr_t foo(void) { + uintptr_t receiver = 2; Obj *objrcvr; Obj <Proto> *objrcvr2; /* NB: Since 'receiver' is an invalid ObjC message receiver, the compiler should warn but then search for methods as if we were messaging 'id'. */ - receiver += [receiver someValue]; /* { dg-warning "invalid receiver type .long int." } */ - receiver += [receiver anotherValue]; /* { dg-warning "invalid receiver type .long int." } */ + receiver += [receiver someValue]; /* { dg-warning "invalid receiver type .uintptr_t." } */ + receiver += [receiver anotherValue]; /* { dg-warning "invalid receiver type .uintptr_t." } */ receiver += [(Obj *)receiver someValue]; /* { dg-warning ".Obj. may not respond to .\\-someValue." } */ /* { dg-error "invalid conversion" "" { target *-*-* } .-1 } */
reply other threads:[~2024-04-22 13:10 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20240422131010.1A86B3858402@sourceware.org \ --to=iains@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).