public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ppluzhnikov at google dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/53524] New: [4.7/4.8 Regression] Bogus and unsupressable enum comparison warning
Date: Wed, 30 May 2012 01:53:00 -0000	[thread overview]
Message-ID: <bug-53524-4@http.gcc.gnu.org/bugzilla/> (raw)

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

             Bug #: 53524
           Summary: [4.7/4.8 Regression] Bogus and unsupressable enum
                    comparison warning
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ppluzhnikov@google.com


Created attachment 27519
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27519
test case

Test case reduced from llvm/utils/TableGen/AsmMatcherEmitter.cpp

First noticed in gcc-4.7, confirmed in 4.8.0 20120515.

In template metaprogramming, it is quite common to compare enum values from
different instantiations of the same template.

GCC-4.7 started to warn about some of them. Further, the warning doesn't get
suppressed even under -Wno-enum-compare.

There is also a secondary problem: the diagnostic emitted is particularly lousy
-- it points to the enum itself, leaving no clue as to what GCC is complaining
about:

g++ -c tt.cc
tt.cc: In instantiation of ‘struct PointerUnionUIntTraits<CodeGenInstruction*,
CodeGenInstAlias*>’:
tt.cc:10:8:   required from ‘struct
PointerIntPair<PointerUnionUIntTraits<CodeGenInstruction*, CodeGenInstAlias*>
>’
tt.cc:23:9:   required from ‘class PointerUnion<CodeGenInstruction*,
CodeGenInstAlias*>’
tt.cc:27:61:   required from here
tt.cc:14:8: warning: enumeral mismatch in conditional expression:
‘PointerLikeTypeTraits<CodeGenInstruction*>::<anonymous enum>’ vs
‘PointerLikeTypeTraits<CodeGenInstAlias*>::<anonymous enum>’ [enabled by
default]
   enum {
        ^


             reply	other threads:[~2012-05-30  1:48 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-30  1:53 ppluzhnikov at google dot com [this message]
2012-05-30  2:25 ` [Bug c++/53524] " pinskia at gcc dot gnu.org
2012-05-30  2:59 ` jyasskin at gcc dot gnu.org
2012-05-30  4:45 ` crowl at google dot com
2012-05-30  8:17 ` manu at gcc dot gnu.org
2012-05-30  8:54 ` [Bug c++/53524] [4.7/4.8 Regression] Bogus and unsuppressible " paolo.carlini at oracle dot com
2012-05-30  9:54 ` rguenth at gcc dot gnu.org
2012-05-30 10:35 ` paolo.carlini at oracle dot com
2012-05-30 11:14 ` paolo.carlini at oracle dot com
2012-05-30 16:45 ` manu at gcc dot gnu.org
2012-05-30 17:37 ` paolo.carlini at oracle dot com
2012-05-30 17:42 ` crowl at google dot com
2012-05-30 17:43 ` crowl at google dot com
2012-05-30 17:55 ` manu at gcc dot gnu.org
2012-05-30 18:43 ` paolo.carlini at oracle dot com
2012-05-31  3:01 ` paolo.carlini at oracle dot com
2012-05-31 17:33 ` crowl at google dot com
2012-05-31 18:05 ` paolo.carlini at oracle dot com
2012-05-31 21:14 ` crowl at google dot com
2012-05-31 21:24 ` paolo.carlini at oracle dot com
2012-05-31 21:42 ` ppluzhnikov at google dot com
2012-06-04 19:28 ` paolo at gcc dot gnu.org
2012-06-04 20:31 ` paolo at gcc dot gnu.org
2012-06-13 13:50 ` rguenth at gcc dot gnu.org
2012-06-13 14:01 ` paolo.carlini at oracle dot com
2012-06-14  8:11 ` rguenth at gcc dot gnu.org
2012-06-19 21:57 ` ppluzhnikov at google dot com
2012-06-25 15:51 ` [Bug c++/53524] [4.7/4.8 Regression] Bogus " jason at gcc dot gnu.org
2012-07-02 19:15 ` jason at gcc dot gnu.org
2012-07-02 19:24 ` jason at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-53524-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).