Commit 4b48a93e by Nathan Sidwell Committed by Nathan Sidwell

call.c (build_new_op): Convert args from reference here.

cp:
	* call.c (build_new_op): Convert args from reference here.
	(build_conditional_expr): Don't convert here.
testsuite:
	* g++.old-deja/g++.pt/ref4.C: New test.

From-SVN: r41721
parent 1bcea8d7
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.
(read_token): Set it here.
(yyerror): Use it here.
......
......@@ -2892,11 +2892,6 @@ build_conditional_expr (arg1, arg2, arg3)
|| 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
......@@ -3244,6 +3239,12 @@ build_new_op (code, flags, arg1, arg2, arg3)
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.
......
// 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> ();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment