+2007-11-05 Douglas Gregor <doug.gregor@gmail.com>
+
+ PR c++/33939
+ * pt.c (unify_pack_expansion): bring handling of function call
+ arguments into line with type_unification_real.
+
2007-11-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
* typeck.c (build_binary_op): Use pedwarn instead of error for
/* Unify the pattern with the current argument. */
{
tree arg = TREE_VEC_ELT (packed_args, i);
+ tree arg_expr = NULL_TREE;
int arg_strict = strict;
bool skip_arg_p = false;
if (!skip_arg_p)
{
- arg = TREE_TYPE (arg);
+ arg_expr = arg;
+ arg = unlowered_expr_type (arg);
if (arg == error_mark_node)
return 1;
}
if (!subr)
arg_strict |=
- maybe_adjust_types_for_deduction (strict, &parm, &arg, NULL);
+ maybe_adjust_types_for_deduction (strict, &parm, &arg,
+ arg_expr);
}
if (!skip_arg_p)
+2007-11-05 Douglas Gregor <doug.gregor@gmail.com>
+
+ PR c++/33939
+ * g++.dg/cpp0x/variadic-rref.C: New.
+
2007-11-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
* g++dg/warn/pointer-integer-comparison.C: New.
--- /dev/null
+// { dg-options "-std=c++0x" }
+// PR c++/33939
+template<typename T>
+struct refs_only;
+
+template<typename T>
+struct refs_only<T &>
+{};
+
+template<typename T>
+refs_only<T> foo( T && t)
+{
+ return refs_only<T>();
+}
+
+template<typename... T>
+struct va_refs_only;
+
+template<typename T>
+struct va_refs_only<T>
+ : refs_only<T>
+{};
+
+template<typename... T>
+va_refs_only<T...> bar( T &&... t)
+{
+ return va_refs_only<T...>();
+}
+
+int main()
+{
+ int j = 0;
+ foo(j);
+ bar(j); // error: invalid use of incomplete type 'struct refs_only<int>'
+}
+