On Fri, Oct 13, 2017 at 5:40 AM, Markus Trippelsdorf <mar...@trippelsdorf.de> wrote: > r253266 introduced a bogus "cannot bind bitfield" error that breaks > building Chromium and Node.js. > Fix by removing the ugly goto. > > Tested on ppc64le. > Ok for trunk?
No, this just undoes my change, so we go back to not doing type checking for non-dependent static casts. Better I think to avoid the call to build_static_cast in the first place, by teaching stabilize_reference that it can return a NON_DEPENDENT_EXPR unchanged. How does this (untested) patch work for you?
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index e21ff6a1572..366f46f1506 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -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: