* decl.c (cp_make_fname_decl): Free return value from
fname_as_string.
+2004-05-28 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/15083
+ * decl2.c (delete_sanity): Set TREE_SIDE_EFFECTS on a DELETE_EXPR,
+ even in a templat.e
+ * init.c (build_new): Likewise.
+
+ PR c++/15640
+ * name-lookup.c (arg_assoc): Robustify.
+
+ PR c++/15471
+ * typeck.c (unary_complex_lvalue): Use context_for_name_lookup
+ when determining the scope to use for a pointer to member.
+
2004-05-28 Mark Mitchell <mark@codesourcery.com>
PR c++/14668
t = build_min (DELETE_EXPR, void_type_node, exp, size);
DELETE_EXPR_USE_GLOBAL (t) = use_global_delete;
DELETE_EXPR_USE_VEC (t) = doing_vec;
+ TREE_SIDE_EFFECTS (t) = 1;
return t;
}
rval = build_min (NEW_EXPR, build_pointer_type (type),
placement, t, init);
NEW_EXPR_USE_GLOBAL (rval) = use_global_new;
+ TREE_SIDE_EFFECTS (rval) = 1;
return rval;
}
if (arg_assoc_template_arg (k, TREE_VEC_ELT (args, ix)) == 1)
return true;
}
- else
+ else if (TREE_CODE (n) == OVERLOAD)
{
- my_friendly_assert (TREE_CODE (n) == OVERLOAD, 980715);
-
for (; n; n = OVL_CHAIN (n))
if (arg_assoc_type (k, TREE_TYPE (OVL_FUNCTION (n))))
return true;
return error_mark_node;
}
- type = build_ptrmem_type (DECL_FIELD_CONTEXT (t), TREE_TYPE (t));
+ type = build_ptrmem_type (context_for_name_lookup (t),
+ TREE_TYPE (t));
t = make_ptrmem_cst (type, TREE_OPERAND (arg, 1));
return t;
}
* gcc.dg/altivec-15.c: New test.
+2004-05-28 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/15083
+ * g++.dg/warn/noeffect6.C: New test.
+
+ PR c++/15471
+ * g++.dg/expr/ptrmem4.C: New test.
+
+ PR c++/15640
+ * g++.dg/template/operator3.C: New test.
+
2004-05-28 Mark Mitchell <mark@codesourcery.com>
PR c++/14668
--- /dev/null
+// PR c++/15471
+// { dg-do run }
+
+struct myclass {
+ unsigned a;
+ union {
+ unsigned x;
+ };
+};
+
+int main () {
+ myclass foo;
+ unsigned myclass::* member = &myclass::x;
+ if (&(foo.*member) != &foo.x)
+ return 1;
+}
--- /dev/null
+// PR c++/15640
+
+struct A {
+ void foo(void);
+};
+
+template <int> void bar() {
+ A a;
+ a + a.foo; // { dg-error "" }
+}
--- /dev/null
+// { dg-options "-Wall" }
+// PR c++/15083
+
+extern "C" int printf(const char*,...);
+struct Counter {
+ Counter(){printf("Hello World.\n");}
+};
+template< typename T >
+void resetData() {
+ new Counter();
+}
+int main() {
+ resetData<int>();
+}