diff options
author | Tobias Burnus <burnus@net-b.de> | 2010-01-09 10:11:53 +0100 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2010-01-09 10:11:53 +0100 |
commit | 3d876aba229fdb4807f272e10fb0e91505c2fc36 (patch) | |
tree | 223d57c9d520148b8c3c0991db8b128b0bbbd1a6 /gcc/fortran/symbol.c | |
parent | 6b592ab357dd794ea04f33e9431ad7d7e69c1d11 (diff) | |
download | gcc-3d876aba229fdb4807f272e10fb0e91505c2fc36.zip gcc-3d876aba229fdb4807f272e10fb0e91505c2fc36.tar.gz gcc-3d876aba229fdb4807f272e10fb0e91505c2fc36.tar.bz2 |
[multiple changes]
2010-01-09 Tobias Burnus <burnus@net-b.de>
PR fortran/41298
* trans-expr.c (gfc_trans_structure_assign): Handle
c_null_(fun)ptr.
* symbol.c (gen_special_c_interop_ptr): Add NULL_EXPR
to the constructor for c_null_(fun)ptr.
* resolve.c (resolve_structure_cons): Add special case
for c_null_(fun)ptr.
2010-01-09 Tobias Burnus <burnus@net-b.de>
PR fortran/41298
* gfortran.dg/c_ptr_tests_14.f90: New test.
From-SVN: r155755
Diffstat (limited to 'gcc/fortran/symbol.c')
-rw-r--r-- | gcc/fortran/symbol.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 750aa2d..a5787de 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -1,6 +1,6 @@ /* Maintain binary trees of symbols. - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 - Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, + 2009, 2010 Free Software Foundation, Inc. Contributed by Andy Vaught This file is part of GCC. @@ -3690,10 +3690,10 @@ gen_special_c_interop_ptr (int ptr_id, const char *ptr_name, tmp_sym->value->expr_type = EXPR_STRUCTURE; tmp_sym->value->ts.type = BT_DERIVED; tmp_sym->value->ts.u.derived = tmp_sym->ts.u.derived; - /* Create a constructor with no expr, that way we can recognize if the user - tries to call the structure constructor for one of the iso_c_binding - derived types during resolution (resolve_structure_cons). */ tmp_sym->value->value.constructor = gfc_get_constructor (); + tmp_sym->value->value.constructor->expr = gfc_get_expr (); + tmp_sym->value->value.constructor->expr->expr_type = EXPR_NULL; + tmp_sym->value->value.constructor->expr->ts.is_iso_c = 1; /* Must declare c_null_ptr and c_null_funptr as having the PARAMETER attribute so they can be used in init expressions. */ tmp_sym->attr.flavor = FL_PARAMETER; |