* expr.c (mark_exp_read): Handle FLOAT_EXPR similarly to NOP_EXPR.
* g++.dg/warn/Wunused-var-19.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194415
138bc75d-0d04-0410-961f-
82ee72b054a4
+2012-12-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/55643
+ * expr.c (mark_exp_read): Handle FLOAT_EXPR similarly to NOP_EXPR.
+
2012-12-11 Jason Merrill <jason@redhat.com>
PR c++/54416
CASE_CONVERT:
case ADDR_EXPR:
case INDIRECT_REF:
+ case FLOAT_EXPR:
mark_exp_read (TREE_OPERAND (exp, 0));
break;
case COMPOUND_EXPR:
2012-12-11 Jakub Jelinek <jakub@redhat.com>
+ PR c++/55643
+ * g++.dg/warn/Wunused-var-19.C: New test.
+
* g++.dg/asan/asan_test.C: Link -lasan before -lpthread.
2012-12-11 Eric Botcazou <ebotcazou@adacore.com>
--- /dev/null
+// PR c++/55643
+// { dg-do compile }
+// { dg-options "-std=c++11 -Wunused" }
+
+enum class E { e = 123 };
+
+int
+foo ()
+{
+ E x = E::e;
+ return (double) x;
+}
+
+int
+bar ()
+{
+ E x = E::e;
+ return (long double) x;
+}
+
+int
+baz ()
+{
+ E x = E::e;
+ return (float) x;
+}