+2002-08-06 Gabriel Dos Reis <gdr@nerim.net>
+
+ * typeck.c (build_x_unary_op): Handle pointer-to-member.
+
2002-08-05 Geoffrey Keating <geoffk@redhat.com>
* class.c: Don't include obstack.h.
}
if (code == ADDR_EXPR)
{
+ /* A pointer to member-function can be formed only by saying
+ &X::mf. */
+ if (!flag_ms_extensions && TREE_CODE (TREE_TYPE (xarg)) == METHOD_TYPE
+ && (TREE_CODE (xarg) != OFFSET_REF || !PTRMEM_OK_P (xarg)))
+ {
+ if (TREE_CODE (xarg) != OFFSET_REF)
+ {
+ error ("invalid use of '%E' to form a pointer-to-member-function. Use a qualified-id.",
+ xarg);
+ return error_mark_node;
+ }
+ else
+ {
+ error ("parenthesis around '%E' cannot be used to form a pointer-to-member-function",
+ xarg);
+ PTRMEM_OK_P (xarg) = 1;
+ }
+ }
+
if (TREE_CODE (xarg) == OFFSET_REF)
{
ptrmem = PTRMEM_OK_P (xarg);
+2002-08-07 Gabriel Dos Reis <gdr@nerim.net>
+
+ * g++.dg/README (Subdirectories): Document new subdir expr.
+ * g++.dg/expr/pmf-1.C: New test.
+
2002-08-06 Neil Booth <neil@daikokuya.co.uk>
* gcc.dg/cpp/vararg3.c, gcc.dg/cpp/vararg4.c: New tests.
abi Tests for ABI compatibility -- mangling, object layout, etc.
eh Tests for exception handling.
+expr Tests for expressions.
ext Tests for GNU language extensions.
inherit Tests for inheritance -- virtual functions, multiple inheritance, etc.
init Tests for initialization semantics, constructors/destructors, etc.
--- /dev/null
+// C++ PR/2521
+// Copyright (C) 2002 Free Software Foundation
+// Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+// { dg-do compile }
+
+struct A
+{
+ void f();
+ void foo(void (A::*)(int)); // { dg-error "candidate" "" }
+ template<typename T>
+ void g(T);
+ void h()
+ {
+ void (A::*p)() = &A::f;
+ void (A::*q)() = &(A::f); // { dg-error "parenthesis" "" }
+ foo(&g<int>); // { dg-error "" "" }
+ }
+};