Commit 5c9c546b by Jason Merrill Committed by Jason Merrill

PR c++/82357 - bit-field in template

	* tree.c (cp_stabilize_reference): Just return a NON_DEPENDENT_EXPR.

From-SVN: r253739
parent e6110fa6
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.
......
......@@ -333,6 +333,10 @@ cp_stabilize_reference (tree ref)
{
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:
......
// PR c++/82357
template <typename> struct A {
A() { x |= 0; }
int x : 8;
};
template <class T> void f()
{
static_cast<int&>(42); // { dg-error "static_cast" }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment