File tree Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -1416,7 +1416,7 @@ let rec castTo ?(fromsource=false)
14161416 result
14171417
14181418 (* The expression is evaluated for its side-effects *)
1419- | ( TInt _ | TEnum _ | TPtr _ ) , TVoid _ ->
1419+ | _ , TVoid _ ->
14201420 (ot, e)
14211421
14221422 (* Even casts between structs are allowed when we are only
Original file line number Diff line number Diff line change 1+ #include <stdio.h>
2+ #include <tgmath.h>
3+ #include <complex.h>
4+ #include "testharness.h"
5+
6+ typedef struct loc_t
7+ {
8+ long nloc ;
9+ } loc_t ;
10+
11+
12+ void fun (const loc_t * loc ) {
13+ long l = 8 ;
14+ int n0 = (int )sqrt (l ); // works
15+ int n1 = (int )sqrt (loc -> nloc ); // fails
16+ }
17+
18+
19+ int main () {
20+ loc_t loc ;
21+ loc .nloc = 5 ;
22+ loc_t * ptr = & loc ;
23+ fun (ptr );
24+ SUCCESS ;
25+ }
Original file line number Diff line number Diff line change @@ -695,6 +695,7 @@ sub addToGroup {
695695addTest(" testrunc99/c99-universal-character-names" );
696696
697697addTest(" testrunc99/c99-tgmath" );
698+ addTest(" testrunc99/c99-tgmath2" );
698699addTest(" testrunc99/c99-float-pragma" );
699700addTest(" testrunc99/c99-fixed-width-int" );
700701addTest(" combinec99inline" );
You can’t perform that action at this time.
0 commit comments