[Bug c++/19291] Warning "cannot pass objects of non-POD type" should be an error
joseph at codesourcery dot com
gcc-bugzilla@gcc.gnu.org
Thu Aug 13 12:24:00 GMT 2009
------- Comment #5 from joseph at codesourcery dot com 2009-08-13 12:23 -------
Subject: Re: Warning "cannot pass objects of non-POD type"
should be an error
On Thu, 13 Aug 2009, redi at gcc dot gnu dot org wrote:
> I don't know about C, but C++ says:
>
> "permissible undefined behavior ranges from ignoring the situation completely
> with unpredictable results, to behaving during translation or program execution
> in a documented manner characteristic of the environment (with or without
> the issuance of a diagnostic message), to terminating a translation or
> execution (with the issuance of a diagnostic message)." [defns.undefined]
>
> So it is permissible to terminate translation and issue a diagnostic.
You have to read the relevant standard text carefully to determine whether
it is the program that is undefined, or a particular execution of the
program, in this particular instance of undefined behavior. If the
undefinedness is a property of the program (for example, ODR violation),
translation may be terminated. If the undefinedness is a property of a
particular execution of the program (for example, signed integer
overflow), translation may not be terminated unless all possible
executions of the program exhibit that undefined behavior.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19291
More information about the Gcc-bugs
mailing list