mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-19 01:50:34 +08:00
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:
parent
e6110fa622
commit
5c9c546b9d
@ -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.
|
||||
|
@ -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:
|
||||
|
6
gcc/testsuite/g++.dg/template/bitfield4.C
Normal file
6
gcc/testsuite/g++.dg/template/bitfield4.C
Normal file
@ -0,0 +1,6 @@
|
||||
// PR c++/82357
|
||||
|
||||
template <typename> struct A {
|
||||
A() { x |= 0; }
|
||||
int x : 8;
|
||||
};
|
4
gcc/testsuite/g++.dg/template/cast4.C
Normal file
4
gcc/testsuite/g++.dg/template/cast4.C
Normal file
@ -0,0 +1,4 @@
|
||||
template <class T> void f()
|
||||
{
|
||||
static_cast<int&>(42); // { dg-error "static_cast" }
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user