diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2010-10-06 14:35:25 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2010-10-06 14:35:25 +0000 |
commit | ccd2b322781729ee41f7f44eae1b519c6d0ec4c7 (patch) | |
tree | 26a4afae364c992b478e346ca217b54552ba08ec /gcc/cp | |
parent | 9c506f103cda9948114a65c27a46e05b0e116222 (diff) | |
download | gcc-ccd2b322781729ee41f7f44eae1b519c6d0ec4c7.zip gcc-ccd2b322781729ee41f7f44eae1b519c6d0ec4c7.tar.gz gcc-ccd2b322781729ee41f7f44eae1b519c6d0ec4c7.tar.bz2 |
re PR c++/45908 ([C++0x] ICE involving decltype: in tree_low_cst, at tree.h:4114)
PR c++/45908
* typeck.c (cp_build_addr_expr_1): Add check for incomplete types in
code folding offsetof-like computations.
From-SVN: r165031
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e347e6d..8143763a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2010-10-06 Eric Botcazou <ebotcazou@adacore.com> + + PR c++/45908 + * typeck.c (cp_build_addr_expr_1): Add check for incomplete types in + code folding offsetof-like computations. + 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com> PR objc++/31125 diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index b2b8e5f..ff5714d 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -4947,6 +4947,7 @@ cp_build_addr_expr_1 (tree arg, bool strict_lvalue, tsubst_flags_t complain) && TREE_CODE (argtype) != METHOD_TYPE && argtype != unknown_type_node && (val = get_base_address (arg)) + && COMPLETE_TYPE_P (TREE_TYPE (val)) && TREE_CODE (val) == INDIRECT_REF && TREE_CONSTANT (TREE_OPERAND (val, 0))) { |