Commit 98b3c04e by Jason Merrill Committed by Jason Merrill

re PR c++/50034 (Overload selection failure within class template)

	PR c++/50034
	* call.c (convert_arg_to_ellipsis): force_rvalue only in
	potentially evaluated context.

From-SVN: r177722
parent 7b4ef662
2011-08-12 Jason Merrill <jason@redhat.com>
PR c++/50034
* call.c (convert_arg_to_ellipsis): force_rvalue only in
potentially evaluated context.
2011-08-12 Richard Guenther <rguenther@suse.de> 2011-08-12 Richard Guenther <rguenther@suse.de>
* call.c (build_over_call): Instead of memcpy use an * call.c (build_over_call): Instead of memcpy use an
......
...@@ -6097,7 +6097,7 @@ convert_arg_to_ellipsis (tree arg) ...@@ -6097,7 +6097,7 @@ convert_arg_to_ellipsis (tree arg)
{ {
/* Build up a real lvalue-to-rvalue conversion in case the /* Build up a real lvalue-to-rvalue conversion in case the
copy constructor is trivial but not callable. */ copy constructor is trivial but not callable. */
if (CLASS_TYPE_P (arg_type)) if (!cp_unevaluated_operand && CLASS_TYPE_P (arg_type))
force_rvalue (arg, tf_warning_or_error); force_rvalue (arg, tf_warning_or_error);
/* [expr.call] 5.2.2/7: /* [expr.call] 5.2.2/7:
......
2011-08-12 Jason Merrill <jason@redhat.com>
PR c++/50034
* g++.dg/cpp0x/defaulted28.C: Add unevaluated case.
2011-08-12 Uros Bizjak <ubizjak@gmail.com> 2011-08-12 Uros Bizjak <ubizjak@gmail.com>
* gcc.dg/builtins-67.c: New test. * gcc.dg/builtins-67.c: New test.
......
// PR c++/49102 // PR c++/49102
// PR c++/50034
// { dg-options -std=c++0x } // { dg-options -std=c++0x }
struct A { struct A {
...@@ -8,8 +9,9 @@ private: ...@@ -8,8 +9,9 @@ private:
A(A const&) = default; // { dg-error "private" } A(A const&) = default; // { dg-error "private" }
}; };
void f(...) { } int f(...) { }
int main() { int main() {
A a; A a;
f(a); // { dg-error "this context" } f(a); // { dg-error "this context" }
sizeof(f(a)); // OK because unevaluated
} }
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