diff options
author | Mark Mitchell <mark@codesourcery.com> | 2007-07-06 01:23:54 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2007-07-06 01:23:54 +0000 |
commit | 32a11c08863764dfd6a3be749c0729fee6cd298c (patch) | |
tree | 17dc867104325855fe255d6858ff0978e0b8936c /gcc/cp/pt.c | |
parent | 22761ec3b9b4688e515019b6b97025fda5be6a44 (diff) | |
download | gcc-32a11c08863764dfd6a3be749c0729fee6cd298c.zip gcc-32a11c08863764dfd6a3be749c0729fee6cd298c.tar.gz gcc-32a11c08863764dfd6a3be749c0729fee6cd298c.tar.bz2 |
re PR c++/32245 (wrong POD type initialization with pointer to member)
PR c++/32245
* init.c (build_zero_init): Always build an initializer for
non-static storage.
* typeck2.c (build_functional_cast): Use build_zero_init.
PR c++/32251
* init.c (build_new_1): Always pass the allocation function to
build_op_delete_call.
* call.c (build_op_delete_call): Handle operator delete with a
variable-argument list. Do not issue an error when no matching
deallocation function is available for a new operator.
PR c++/31992
* cp-tree.h (any_value_dependent_elements_p): Declare it.
* decl.c (value_dependent_init_p): New function.
(cp_finish_decl): Use it.
* pt.c (value_dependent_expression_p): Use
any_value_dependent_elements_p.
* parser.c (cp_parser_primary_expression): Add comment about
treating dependent qualified names as integral
constant-expressions.
PR c++/32245
* g++.dg/init/ptrmem4.C: New test.
PR c++/32251
* g++.dg/init/new21.C: Likewise.
PR c++/31992
* g++.dg/template/static30.C: Likewise.
From-SVN: r126399
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r-- | gcc/cp/pt.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 63f8247..b822d95 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -15074,12 +15074,7 @@ value_dependent_expression_p (tree expression) } if (TREE_CODE (expression) == TREE_LIST) - { - for (; expression; expression = TREE_CHAIN (expression)) - if (value_dependent_expression_p (TREE_VALUE (expression))) - return true; - return false; - } + return any_value_dependent_elements_p (expression); return value_dependent_expression_p (expression); } @@ -15308,6 +15303,19 @@ any_type_dependent_arguments_p (tree args) return false; } +/* Returns TRUE if LIST (a TREE_LIST whose TREE_VALUEs are + expressions) contains any value-dependent expressions. */ + +bool +any_value_dependent_elements_p (tree list) +{ + for (; list; list = TREE_CHAIN (list)) + if (value_dependent_expression_p (TREE_VALUE (list))) + return true; + + return false; +} + /* Returns TRUE if the ARG (a template argument) is dependent. */ bool |