2018-04-16  Paolo Carlini  <paolo.carlini@oracle.com>
	    Jason Merrill  <jason@redhat.com>
	PR c++/85112
	* convert.c (convert_to_integer_1): Use direct recursion for
	enumeral types and types with a precision less than the number
	of bits in their mode.
/testsuite
2018-04-16  Paolo Carlini  <paolo.carlini@oracle.com>
	    Jason Merrill  <jason@redhat.com>
	PR c++/85112
	* g++.dg/cpp0x/pr85112.C: New.
Co-Authored-By: Jason Merrill <jason@redhat.com>
From-SVN: r259397
+2018-04-16  Paolo Carlini  <paolo.carlini@oracle.com>
+           Jason Merrill  <jason@redhat.com>
+
+       PR c++/85112
+       * convert.c (convert_to_integer_1): Use direct recursion for
+       enumeral types and types with a precision less than the number
+       of bits in their mode.
+
 2018-04-16  Julia Koval  <julia.koval@intel.com>
 
        PR target/84413
 
       else if (TREE_CODE (type) == ENUMERAL_TYPE
               || maybe_ne (outprec, GET_MODE_PRECISION (TYPE_MODE (type))))
        {
-         expr = convert (lang_hooks.types.type_for_mode
-                         (TYPE_MODE (type), TYPE_UNSIGNED (type)), expr);
+         expr
+           = convert_to_integer_1 (lang_hooks.types.type_for_mode
+                                   (TYPE_MODE (type), TYPE_UNSIGNED (type)),
+                                   expr, dofold);
          return maybe_fold_build1_loc (dofold, loc, NOP_EXPR, type, expr);
        }
 
 
+2018-04-16  Paolo Carlini  <paolo.carlini@oracle.com>
+           Jason Merrill  <jason@redhat.com>
+
+       PR c++/85112
+       * g++.dg/cpp0x/pr85112.C: New.
+
 2018-04-15  Bill Schmidt  <wschmidt@linux.ibm.com>
 
        PR testsuite/85326
 
--- /dev/null
+// PR c++/85112
+// { dg-do compile { target c++11 } }
+
+struct A
+{
+  int m;
+  int n : 4;
+};
+
+int i;  // { dg-message "not const" }
+
+void foo()
+{
+  constexpr int j = i;  // { dg-error "not usable" }
+  A a;
+  a.n = j;
+}