public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/53224] New: synthesized_method_walk returns uninitialized values
@ 2012-05-04 2:38 hjl.tools at gmail dot com
2012-05-04 2:41 ` [Bug c++/53224] " pinskia at gcc dot gnu.org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: hjl.tools at gmail dot com @ 2012-05-04 2:38 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53224
Bug #: 53224
Summary: synthesized_method_walk returns uninitialized values
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: hjl.tools@gmail.com
static void
synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p,
tree *spec_p, bool *trivial_p, bool *deleted_p,
bool *constexpr_p, bool diag)
{
tree binfo, base_binfo, scope, fnname, rval, argtype;
bool move_p, copy_arg_p, assign_p, expected_trivial, check_vdtor;
VEC(tree,gc) *vbases;
int i, quals, flags;
tsubst_flags_t complain;
const char *msg;
bool ctor_p;
if (spec_p)
*spec_p = (cxx_dialect >= cxx0x ? noexcept_true_spec : empty_except_spec);
if (deleted_p)
{
/* "The closure type associated with a lambda-expression has a deleted
default constructor and a deleted copy assignment operator."
This is diagnosed in maybe_explain_implicit_delete. */
if (LAMBDA_TYPE_P (ctype)
&& (sfk == sfk_constructor
|| sfk == sfk_copy_assignment))
{
*deleted_p = true;
return;
}
*deleted_p = false;
}
trivial_p and constexpr_p may not be initialized here.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/53224] synthesized_method_walk returns uninitialized values
2012-05-04 2:38 [Bug c++/53224] New: synthesized_method_walk returns uninitialized values hjl.tools at gmail dot com
@ 2012-05-04 2:41 ` pinskia at gcc dot gnu.org
2012-05-04 2:43 ` pinskia at gcc dot gnu.org
2013-07-06 23:15 ` paolo.carlini at oracle dot com
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-05-04 2:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53224
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-05-04 02:41:12 UTC ---
I think you need more context than just the above code.
Is *trivial_p and *constexpr_p checked when *deleted_p is true?
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/53224] synthesized_method_walk returns uninitialized values
2012-05-04 2:38 [Bug c++/53224] New: synthesized_method_walk returns uninitialized values hjl.tools at gmail dot com
2012-05-04 2:41 ` [Bug c++/53224] " pinskia at gcc dot gnu.org
@ 2012-05-04 2:43 ` pinskia at gcc dot gnu.org
2013-07-06 23:15 ` paolo.carlini at oracle dot com
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-05-04 2:43 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53224
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-05-04 02:43:22 UTC ---
synthesized_method_walk (type, kind, const_p, &raises, &trivial_p,
&deleted_p, &constexpr_p, false);
/* Don't bother marking a deleted constructor as constexpr. */
if (deleted_p)
constexpr_p = false;
/* A trivial copy/move constructor is also a constexpr constructor. */
else if (trivial_p && cxx_dialect >= cxx0x
&& (kind == sfk_copy_constructor
|| kind == sfk_move_constructor))
gcc_assert (constexpr_p);
if (!trivial_p && type_has_trivial_fn (type, kind))
type_set_nontrivial_flag (type, kind);
So trivial_p could be used uninitialized only as it is obvious that constexpr_p
was set correctly.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/53224] synthesized_method_walk returns uninitialized values
2012-05-04 2:38 [Bug c++/53224] New: synthesized_method_walk returns uninitialized values hjl.tools at gmail dot com
2012-05-04 2:41 ` [Bug c++/53224] " pinskia at gcc dot gnu.org
2012-05-04 2:43 ` pinskia at gcc dot gnu.org
@ 2013-07-06 23:15 ` paolo.carlini at oracle dot com
2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-07-06 23:15 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53224
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |DUPLICATE
--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Dup, already fixed.
*** This bug has been marked as a duplicate of bug 55418 ***
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-07-06 23:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-04 2:38 [Bug c++/53224] New: synthesized_method_walk returns uninitialized values hjl.tools at gmail dot com
2012-05-04 2:41 ` [Bug c++/53224] " pinskia at gcc dot gnu.org
2012-05-04 2:43 ` pinskia at gcc dot gnu.org
2013-07-06 23:15 ` paolo.carlini at oracle dot com
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).