PR c++/80984
* cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
BLOCK_VARS (outer) chain.
(cxx_omp_const_qual_no_mutable): Likewise.
* g++.dg/opt/nrv18.C: New test.
From-SVN: r249173
+2017-06-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/80984
+ * cp-gimplify.c (cp_genericize): Only look for VAR_DECLs in
+ BLOCK_VARS (outer) chain.
+ (cxx_omp_const_qual_no_mutable): Likewise.
+
2017-06-13 Martin Liska <mliska@suse.cz>
PR sanitize/78204
if (outer)
for (var = BLOCK_VARS (outer); var; var = DECL_CHAIN (var))
- if (DECL_NAME (t) == DECL_NAME (var)
+ if (VAR_P (var)
+ && DECL_NAME (t) == DECL_NAME (var)
&& DECL_HAS_VALUE_EXPR_P (var)
&& DECL_VALUE_EXPR (var) == t)
{
if (outer)
for (var = BLOCK_VARS (outer); var; var = DECL_CHAIN (var))
- if (DECL_NAME (decl) == DECL_NAME (var)
+ if (VAR_P (var)
+ && DECL_NAME (decl) == DECL_NAME (var)
&& (TYPE_MAIN_VARIANT (type)
== TYPE_MAIN_VARIANT (TREE_TYPE (var))))
{
+2017-06-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/80984
+ * g++.dg/opt/nrv18.C: New test.
+
2017-06-13 Martin Liska <mliska@suse.cz>
PR sanitize/78204
--- /dev/null
+// PR c++/80984
+// { dg-do compile }
+
+struct A { ~A (); };
+
+A
+foo ()
+{
+ A a;
+a:
+ return a;
+}