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

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

From-SVN: r253739
This commit is contained in:
Jason Merrill 2017-10-13 15:03:41 -04:00 committed by Jason Merrill
parent e6110fa622
commit 5c9c546b9d
4 changed files with 19 additions and 0 deletions

View File

@ -1,3 +1,8 @@
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.

View File

@ -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:

View File

@ -0,0 +1,6 @@
// PR c++/82357
template <typename> struct A {
A() { x |= 0; }
int x : 8;
};

View File

@ -0,0 +1,4 @@
template <class T> void f()
{
static_cast<int&>(42); // { dg-error "static_cast" }
}