public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13683] New: [3.3/3.4 Regression] bogus warning about passing non-PODs through ellipsis
@ 2004-01-14 16:57 giovannibajo at libero dot it
  2004-01-14 16:58 ` [Bug c++/13683] " giovannibajo at libero dot it
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: giovannibajo at libero dot it @ 2004-01-14 16:57 UTC (permalink / raw)
  To: gcc-bugs

The following code emits a bogus warning:

-----------------------------------------------------
struct B {};
struct NonPOD : B {};

struct A
{
  static int check(...);
  static NonPOD GetNonPOD(void);
  enum { value = sizeof(A::check(A::GetNonPOD())) };
};
-----------------------------------------------------
bogus.cc:8: warning: cannot pass objects of non-POD type `struct NonPOD' 
through `...'; call will abort at runtime


The problem is that GCC fails to realize that the function call will never 
happen because it's done in the context of a sizeof() expression. Thus, the 
warning should not be emitted. Notice that this warning is on by default, and I 
don't even know if there is a way to shut it off.

Regression since 2.95 (where the warning probably didn't exist, but from an 
user standpoint it's a regression).

BTW this was noticed with Boost code, so it's real world stuff. Luckily, the 
warning is not affected by -Werror. I rate this as a very minor regression, but 
it would be great if we could fix it someday.

-- 
           Summary: [3.3/3.4 Regression] bogus warning about passing non-
                    PODs through ellipsis
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: minor
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: giovannibajo at libero dot it
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13683


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2004-01-30 18:32 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-14 16:57 [Bug c++/13683] New: [3.3/3.4 Regression] bogus warning about passing non-PODs through ellipsis giovannibajo at libero dot it
2004-01-14 16:58 ` [Bug c++/13683] " giovannibajo at libero dot it
2004-01-14 17:31 ` pinskia at gcc dot gnu dot org
2004-01-14 21:40 ` bangerth at dealii dot org
2004-01-15  2:07 ` giovannibajo at libero dot it
2004-01-16 18:12 ` mmitchel at gcc dot gnu dot org
2004-01-19 14:54 ` giovannibajo at libero dot it
2004-01-20  7:54 ` mmitchel at gcc dot gnu dot org
2004-01-20 12:05 ` giovannibajo at libero dot it
2004-01-20 13:55 ` gdr at integrable-solutions dot net
2004-01-20 14:11 ` giovannibajo at libero dot it
2004-01-20 15:03 ` gdr at integrable-solutions dot net
2004-01-30 13:14 ` [Bug c++/13683] [3.3/3.4/3.5 " giovannibajo at libero dot it
2004-01-30 15:08 ` cvs-commit at gcc dot gnu dot org
2004-01-30 15:12 ` cvs-commit at gcc dot gnu dot org
2004-01-30 15:14 ` [Bug c++/13683] [3.3/3.4 " giovannibajo at libero dot it
2004-01-30 15:59 ` gdr at integrable-solutions dot net
2004-01-30 16:21 ` cvs-commit at gcc dot gnu dot org
2004-01-30 16:24 ` cvs-commit at gcc dot gnu dot org
2004-01-30 16:24 ` [Bug c++/13683] [3.3 " giovannibajo at libero dot it
2004-01-30 17:11 ` gdr at integrable-solutions dot net
2004-01-30 18:21 ` cvs-commit at gcc dot gnu dot org
2004-01-30 18:31 ` cvs-commit at gcc dot gnu dot org
2004-01-30 18:32 ` giovannibajo at libero dot it

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).