summaryrefslogtreecommitdiff
path: root/gcc/cp/call.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-02 01:58:52 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-02 01:58:52 +0000
commit5575ae2daa739969ccf8ffb03d0f9ed48240c71a (patch)
tree0e2b7a7a4e1509e9c6c21c62383e3c5ac57705e8 /gcc/cp/call.c
parent37cae4bcc1481d61c309b4ad5eba9af5b73bdc8c (diff)
downloadgcc-5575ae2daa739969ccf8ffb03d0f9ed48240c71a.tar.gz
PR c++/16338
* cp-tree.h (DECL_INTEGRAL_CONSTANT_VAR_P): New macro. * call.c (null_ptr_cst_p): Handle variables with constant initializers. * pt.c (convert_nontype_argument): Use DECL_INTEGRAL_CONSTANT_VAR_P. * semantics.c (finish_id_expression): Likewise. PR c++~/16489 * decl.c (duplicate_decls): Reject duplicate namespace declarations. PR c++/16810 * typeck.c (build_ptrmemfunc): Loosen assertion. PR c++/16338 * g++.dg/init/null1.C: New test. * g++.dg/tc1/dr76.C: Adjust error marker. PR c++/16489 * g++.dg/parse/namespace10.C: New test. PR c++/16810 * g++.dg/inherit/ptrmem2.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85421 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r--gcc/cp/call.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index a6bfc729352..a34eb271001 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -429,6 +429,9 @@ struct z_candidate {
z_candidate *next;
};
+/* Returns true iff T is a null pointer constant in the sense of
+ [conv.ptr]. */
+
bool
null_ptr_cst_p (tree t)
{
@@ -436,13 +439,14 @@ null_ptr_cst_p (tree t)
A null pointer constant is an integral constant expression
(_expr.const_) rvalue of integer type that evaluates to zero. */
+ if (DECL_INTEGRAL_CONSTANT_VAR_P (t))
+ t = decl_constant_value (t);
if (t == null_node
|| (CP_INTEGRAL_TYPE_P (TREE_TYPE (t)) && integer_zerop (t)))
return true;
return false;
}
-
/* Returns nonzero if PARMLIST consists of only default parms and/or
ellipsis. */