* tree.c (cp_stabilize_reference): Just return a NON_DEPENDENT_EXPR.
From-SVN: r253739
+2017-10-13 Jason Merrill <jason@redhat.com>
+
+ PR c++/82357 - bit-field in template
+ * tree.c (cp_stabilize_reference): Just return a NON_DEPENDENT_EXPR.
+
2017-10-13 David Malcolm <dmalcolm@redhat.com>
* cp-tree.h (maybe_show_extern_c_location): New decl.
{
switch (TREE_CODE (ref))
{
+ case NON_DEPENDENT_EXPR:
+ /* We aren't actually evaluating this. */
+ return ref;
+
/* We need to treat specially anything stabilize_reference doesn't
handle specifically. */
case VAR_DECL:
--- /dev/null
+// PR c++/82357
+
+template <typename> struct A {
+ A() { x |= 0; }
+ int x : 8;
+};
--- /dev/null
+template <class T> void f()
+{
+ static_cast<int&>(42); // { dg-error "static_cast" }
+}