+2001-12-19 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/90
+ * typeck.c (build_function_call_real): Use original function
+ expression for errors.
+
2001-12-18 Jason Merrill <jason@redhat.com>
* class.c (add_method): Do compare 'this' quals when trying to match a
tree result;
tree name = NULL_TREE, assembler_name = NULL_TREE;
int is_method;
+ tree original = function;
/* build_c_cast puts on a NOP_EXPR to make the result not an lvalue.
Strip such NOP_EXPRs, since FUNCTION is used in non-lvalue context. */
/* Differs from default_conversion by not setting TREE_ADDRESSABLE
(because calling an inline function does not mean the function
needs to be separately compiled). */
-
+
if (DECL_INLINE (function))
function = inline_conversion (function);
else
if (TYPE_PTRMEMFUNC_P (fntype))
{
error ("must use .* or ->* to call pointer-to-member function in `%E (...)'",
- function);
+ original);
return error_mark_node;
}
|| is_method
|| TREE_CODE (function) == TEMPLATE_ID_EXPR))
{
- error ("`%E' cannot be used as a function", function);
+ error ("`%E' cannot be used as a function", original);
return error_mark_node;
}
+2001-12-19 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.dg/other/error1.C: New test.
+
Mon Dec 17 14:31:42 2001 Jeffrey A Law (law@redhat.com)
* gcc.c-torture/execute/20011217-1.c: New test.
--- /dev/null
+// { dg-do compile }
+
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 18 Dec 2001 <nathan@nathan@codesourcery.com>
+
+// PR 90, stupid error message `(this + 160)'
+
+class foo {
+ public:
+ int fudge[40];
+ int bar [40];
+ inline int access(int i) {
+ return bar(i); // { dg-error "`this->foo::bar' cannot" "" }
+ }
+};