+2019-09-23 Jason Merrill <jason@redhat.com>
+
+ PR c++/91809 - bit-field and ellipsis.
+ * call.c (convert_arg_to_ellipsis): Don't call decay_conversion for
+ arithmetic arguments.
+
2019-09-23 Marek Polacek <polacek@redhat.com>
PR c++/91844 - Implement CWG 2352, Similar types and reference binding.
tree
convert_arg_to_ellipsis (tree arg, tsubst_flags_t complain)
{
- tree arg_type;
+ tree arg_type = TREE_TYPE (arg);
location_t loc = cp_expr_loc_or_input_loc (arg);
- /* [expr.call]
-
- The lvalue-to-rvalue, array-to-pointer, and function-to-pointer
- standard conversions are performed. */
- arg = decay_conversion (arg, complain);
- arg_type = TREE_TYPE (arg);
/* [expr.call]
If the argument has integral or enumeration type that is subject
else
arg = cp_perform_integral_promotions (arg, complain);
}
+ else
+ /* [expr.call]
+
+ The lvalue-to-rvalue, array-to-pointer, and function-to-pointer
+ standard conversions are performed. */
+ arg = decay_conversion (arg, complain);
arg = require_complete_type_sfinae (arg, complain);
arg_type = TREE_TYPE (arg);
--- /dev/null
+// { dg-additional-options "-Wformat" }
+
+extern "C" int printf (const char *, ...);
+
+struct X {
+ unsigned long long a: 1;
+} x;
+
+void foo()
+{
+ printf("%d", x.a);
+}