public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/53524] New: [4.7/4.8 Regression] Bogus and unsupressable enum comparison warning
@ 2012-05-30  1:53 ppluzhnikov at google dot com
  2012-05-30  2:25 ` [Bug c++/53524] " pinskia at gcc dot gnu.org
                   ` (28 more replies)
  0 siblings, 29 replies; 30+ messages in thread
From: ppluzhnikov at google dot com @ 2012-05-30  1:53 UTC (permalink / raw)
  To: gcc-bugs

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 {
        ^


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

end of thread, other threads:[~2012-07-02 19:24 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-30  1:53 [Bug c++/53524] New: [4.7/4.8 Regression] Bogus and unsupressable enum comparison warning ppluzhnikov at google dot com
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

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