This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/78826] jump bypasses non-POD


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78826

--- Comment #3 from Krzysztof Laskowski <aurzenligl at gmail dot com> ---
(In reply to Jonathan Wakely from comment #2)
> I assume GCC 4.5 stopped diagnosing it due to the revised specification
> which only cares about trivial constructor or trivial destructor, not
> PODness.
I couldn't actually find any clause allowing jump over trivially constructed
variable in ISO/IEC 14882:1998 nor ISO/IEC 14882:2003. Moreover, icc (13, 16,
17) and clang (3.0-3.9) warn and err, respectively, on example.

It seems to correlate with introducing c++0x support in gcc.
https://gcc.gnu.org/gcc-4.5/changes.html
"Diagnostics that used to complain about passing non-POD types to ... or
jumping past the declaration of a non-POD variable now check for triviality
rather than PODness, as per C++0x."

> Giving a diagnostic here would just be pedantic and unhelpful.
I agree it's harmless to bypass trivially constructed variable. Does it mean
that it's a deliberate deviation from standard for the sake of ease of c++11
implementation at the cost of portability/conformance?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]