* cvt.c (ocp_convert): Use build_nop to convert to underlying type
of scoped enum.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172284
138bc75d-0d04-0410-961f-
82ee72b054a4
2011-04-11 Jason Merrill <jason@redhat.com>
+ PR c++/48534
+ * cvt.c (ocp_convert): Use build_nop to convert to underlying type
+ of scoped enum.
+
PR c++/48523
* tree.c (maybe_dummy_object): Use build_x_indirect_ref rather
than cp_build_indirect_ref.
/* We can't implicitly convert a scoped enum to bool, so convert
to the underlying type first. */
if (SCOPED_ENUM_P (intype) && (convtype & CONV_STATIC))
- e = convert (ENUM_UNDERLYING_TYPE (intype), e);
+ e = build_nop (ENUM_UNDERLYING_TYPE (intype), e);
return cp_truthvalue_conversion (e);
}
2011-04-11 Jason Merrill <jason@redhat.com>
+ * g++.dg/cpp0x/enum10.C: New.
+
* g++.dg/cpp0x/lambda/lambda-this4.C: New.
* g++.dg/cpp0x/rv-func.C: New.
--- /dev/null
+// PR c++/48534
+// { dg-options -std=c++0x }
+
+enum class OpSE : bool;
+
+int main()
+{
+ return static_cast<bool>(OpSE());
+}