Skip to content

Commit fb9deab

Browse files
committed
Add additional test coverage for WG14 N3042
This addresses a post-commit request for some additional tests
1 parent 77cfa38 commit fb9deab

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clang/test/C/C23/n3042.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ void test() {
8383
(float)null_val; // expected-error {{cannot cast an object of type 'nullptr_t' to 'float'}}
8484
(float)nullptr; // expected-error {{cannot cast an object of type 'nullptr_t' to 'float'}}
8585
(nullptr_t)(int *)12; // expected-error {{cannot cast an object of type 'int *' to 'nullptr_t'}}
86+
(nullptr_t)"testing"; // expected-error {{cannot cast an object of type 'char *' to 'nullptr_t'}}
87+
(nullptr_t)1.0f; // expected-error {{cannot cast an object of type 'float' to 'nullptr_t'}}
88+
(nullptr_t)'a'; // expected-error {{cannot cast an object of type 'int' to 'nullptr_t'}}
8689

8790
(void)null_val; // ok
8891
(void)nullptr; // ok

0 commit comments

Comments
 (0)