PR c++/47200
* semantics.c (cxx_bind_parameters_in_call): Don't call
adjust_temp_type on non-constant args.
From-SVN: r170620
2011-03-01 Jason Merrill <jason@redhat.com>
+ PR c++/47200
+ * semantics.c (cxx_bind_parameters_in_call): Don't call
+ adjust_temp_type on non-constant args.
+
PR c++/47851
* call.c (standard_conversion): Provide requested cv-quals on
class rvalue conversion.
/* Just discard ellipsis args after checking their constantitude. */
if (!parms)
continue;
+ if (*non_constant_p)
+ /* Don't try to adjust the type of non-constant args. */
+ goto next;
/* Make sure the binding has the same type as the parm. */
if (TREE_CODE (type) != REFERENCE_TYPE)
+2011-03-01 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/constexpr-non-const-arg2.C: New.
+
2011-03-02 Richard Sandiford <richard.sandiford@linaro.org>
PR rtl-optimization/47925
--- /dev/null
+// PR c++/47200
+// { dg-options "-std=c++0x -w" }
+
+template < int > struct duration
+{
+ constexpr int count ();
+ static constexpr duration min ();
+};
+
+constexpr int
+f (duration < 0 > d, duration < 0 > )
+{
+ return d.count ();
+}
+
+static_assert (f (duration < 0 >::min (), duration < 0 > ()), ""); // { dg-error "non-constant|before its definition" }