+2009-02-13 Jason Merrill <jason@redhat.com>
+
+ PR c++/39070
+ * semantics.c (finish_call_expr): Change koenig_p parm to int.
+ If -1, don't set KOENIG_LOOKUP_P but do keep hidden candidates.
+ * cp-tree.h: Adjust prototype.
+ * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Pass -1.
+
2009-02-03 Paolo Bonzini <bonzini@gnu.org>
PR c++/36897
extern tree finish_stmt_expr (tree, bool);
extern tree stmt_expr_value_expr (tree);
extern tree perform_koenig_lookup (tree, tree);
-extern tree finish_call_expr (tree, tree, bool, bool);
+extern tree finish_call_expr (tree, tree, bool, int);
extern tree finish_increment_expr (tree, enum tree_code);
extern tree finish_this_expr (void);
extern tree finish_pseudo_destructor_expr (tree, tree, tree);
qualified_p ? LOOKUP_NONVIRTUAL : LOOKUP_NORMAL,
/*fn_p=*/NULL));
}
- /* Pass true for koenig_p so that build_new_function_call will
+ /* Pass -1 for koenig_p so that build_new_function_call will
allow hidden friends found by arg-dependent lookup at template
parsing time. */
return finish_call_expr (function, call_args,
/*disallow_virtual=*/qualified_p,
- /*koenig_p*/true);
+ /*koenig_p*/-1);
}
case COND_EXPR:
qualified. For example a call to `X::f' never generates a virtual
call.)
+ KOENIG_P is 1 if we want to perform argument-dependent lookup,
+ -1 if we don't, but we want to accept functions found by previous
+ argument-dependent lookup, and 0 if we want nothing to do with it.
+
Returns code for the call. */
tree
-finish_call_expr (tree fn, tree args, bool disallow_virtual, bool koenig_p)
+finish_call_expr (tree fn, tree args, bool disallow_virtual, int koenig_p)
{
tree result;
tree orig_fn;
|| any_type_dependent_arguments_p (args))
{
result = build_nt_call_list (fn, args);
- KOENIG_LOOKUP_P (result) = koenig_p;
+ KOENIG_LOOKUP_P (result) = koenig_p > 0;
if (cfun)
{
do
if (!result)
/* A call to a namespace-scope function. */
- result = build_new_function_call (fn, args, koenig_p);
+ result = build_new_function_call (fn, args, koenig_p != 0);
}
else if (TREE_CODE (fn) == PSEUDO_DTOR_EXPR)
{
+2009-02-13 Jason Merrill <jason@redhat.com>
+
+ PR c++/39070
+ * g++.dg/cpp0x/decltype16.C: New.
+
2009-02-13 Joseph Myers <joseph@codesourcery.com>
PR c/35444
2009-02-10 Steve Ellcey <sje@cup.hp.com>
PR c/39084
- gcc.dg/pr39084.c: New test.
+ * gcc.dg/pr39084.c: New test.
2009-02-09 Janis Johnson <janis187@us.ibm.com>
--- /dev/null
+// PR c++/39070
+// { dg-options "-std=c++0x" }
+
+template<typename X> struct junk {
+ template<typename Z> static Z y();
+ template<typename Y> static int test(...);
+ template<typename Y> static char test(decltype(y<Y>())*);
+ static int const value=sizeof(test<X>(0));
+};
+typedef char type[junk<int>::value==sizeof(char) ? 1 : -1];