+2001-05-01 Nathan Sidwell <nathan@codesourcery.com>
+
+ * call.c (build_new_op): Convert args from reference here.
+ (build_conditional_expr): Don't convert here.
+
2001-05-01 Nathan Sidwell <nathan@codesourcery.com>
* spew.c (last_token_id): New static variable.
|| TREE_TYPE (arg3) == error_mark_node)
return error_mark_node;
- /* Convert from reference types to ordinary types; no expressions
- really have reference type in C++. */
- arg2 = convert_from_reference (arg2);
- arg3 = convert_from_reference (arg3);
-
/* [expr.cond]
If either the second or the third operand has type (possibly
if (arg3 && TREE_CODE (arg3) == OFFSET_REF)
arg3 = resolve_offset_ref (arg3);
+ arg1 = convert_from_reference (arg1);
+ if (arg2)
+ arg2 = convert_from_reference (arg2);
+ if (arg3)
+ arg3 = convert_from_reference (arg3);
+
if (code == COND_EXPR)
{
if (arg2 == NULL_TREE
+2001-05-01 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.pt/ref4.C: New test.
+
2001-04-30 Richard Henderson <rth@redhat.com>
* gcc.dg/20000724-1.c: Revert last change.
--- /dev/null
+// Build don't link:
+//
+// Copyright (C) 2001 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 29 Apr 2001 <nathan@codesourcery.com>
+
+// Bug 2664. We failed to convert_from_reference for non-type
+// template parms.
+
+struct cow { };
+
+cow c;
+
+void func (cow &c) {}
+void operator-(cow &c) {}
+
+template<cow &C> void test()
+{
+ func(C); //OK
+ -C; //bogus error
+}
+
+int main()
+{
+ test<c> ();
+}