* [C++ PATCH] Prevent -Wmaybe-uninitialized warning (PR sanitizer/67867)
@ 2015-10-06 17:31 Marek Polacek
2015-10-07 14:04 ` Jason Merrill
0 siblings, 1 reply; 2+ messages in thread
From: Marek Polacek @ 2015-10-06 17:31 UTC (permalink / raw)
To: GCC Patches, Jason Merrill
This ought to kill a -Wmaybe-uninitialized warning which can be
seen when doing a bootstrap-ubsan -- which then duly fails.
Bootstrapped/regtested on x86_64-linux, ok for trunk?
2015-10-06 Marek Polacek <polacek@redhat.com>
PR sanitizer/67867
* search.c (accessible_p): Initialize OTYPE to NULL_TREE.
diff --git gcc/cp/search.c gcc/cp/search.c
index 508e66c..56bb266 100644
--- gcc/cp/search.c
+++ gcc/cp/search.c
@@ -961,7 +961,7 @@ accessible_p (tree type, tree decl, bool consider_local_p)
&& (!processing_template_parmlist || processing_template_decl > 1))
return 1;
- tree otype;
+ tree otype = NULL_TREE;
if (!TYPE_P (type))
{
/* When accessing a non-static member, the most derived type in the
Marek
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-07 14:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-06 17:31 [C++ PATCH] Prevent -Wmaybe-uninitialized warning (PR sanitizer/67867) Marek Polacek
2015-10-07 14:04 ` Jason Merrill
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).