aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/ccast.d
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2023-08-15 16:29:08 +0200
committerIain Buclaw <ibuclaw@gdcproject.org>2023-08-20 11:20:00 +0200
commitd77c280454cfba48ef38357145cecdabc8c1b05c (patch)
tree49e02afce6ab03a3405752c963b6ffb225012a40 /gcc/testsuite/gdc.test/fail_compilation/ccast.d
parentce33bbfcbc7dd3afc6c96fb48a19ed00f0c598ce (diff)
downloadgcc-d77c280454cfba48ef38357145cecdabc8c1b05c.zip
gcc-d77c280454cfba48ef38357145cecdabc8c1b05c.tar.gz
gcc-d77c280454cfba48ef38357145cecdabc8c1b05c.tar.bz2
d: Merge upstream dmd, druntime 26f049fb26, phobos 330d6a4fd.
D front-end changes: - Import dmd v2.105.0-beta.1. - Added predefined version identifier VisionOS (ignored by GDC). - Functions can no longer have `enum` storage class. - The deprecation of the `body` keyword has been reverted, it is now an obsolete feature. - The error for `scope class` has been reverted, it is now an obsolete feature. D runtime changes: - Import druntime v2.105.0-beta.1. Phobos changes: - Import phobos v2.105.0-beta.1. - AliasSeq has been removed from std.math. - extern(C) getdelim and getline have been removed from std.stdio. gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 26f049fb26. * dmd/VERSION: Bump version to v2.105.0-beta.1. * d-codegen.cc (get_frameinfo): Check useGC in condition. * d-lang.cc (d_handle_option): Set obsolete parameter when compiling with -Wall. (d_post_options): Set useGC to false when compiling with -fno-druntime. Propagate obsolete flag to compileEnv. * expr.cc (ExprVisitor::visit (CatExp *)): Check useGC in condition. libphobos/ChangeLog: * libdruntime/MERGE: Merge upstream druntime 26f049fb26. * src/MERGE: Merge upstream phobos 330d6a4fd.
Diffstat (limited to 'gcc/testsuite/gdc.test/fail_compilation/ccast.d')
-rw-r--r--gcc/testsuite/gdc.test/fail_compilation/ccast.d21
1 files changed, 20 insertions, 1 deletions
diff --git a/gcc/testsuite/gdc.test/fail_compilation/ccast.d b/gcc/testsuite/gdc.test/fail_compilation/ccast.d
index dab2984..f1ca6c0 100644
--- a/gcc/testsuite/gdc.test/fail_compilation/ccast.d
+++ b/gcc/testsuite/gdc.test/fail_compilation/ccast.d
@@ -1,9 +1,28 @@
/*
TEST_OUTPUT:
---
-fail_compilation/ccast.d(9): Error: C style cast illegal, use `cast(byte)i`
+fail_compilation/ccast.d(11): Error: C style cast illegal, use `cast(byte)i`
+fail_compilation/ccast.d(24): Error: C style cast illegal, use `cast(foo)5`
+fail_compilation/ccast.d(26): Error: C style cast illegal, use `cast(void*)5`
---
*/
int i;
byte b = (byte)i;
+
+void bar(int x);
+
+void main()
+{
+ (&bar)(5); // ok
+ auto foo = &bar;
+ (foo = foo)(5); // ok
+ (*foo)(5); // ok
+
+ (foo)(5); // ok
+ (bar)(5); // ok
+ (foo)5;
+
+ (void*)5;
+ (void*)(5); // semantic implicit cast error
+}