public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/58025] New: Cannot use std::hash without setting off -Wmismatched-tags
@ 2013-07-30  4:39 whatmannerofburgeristhis at gmail dot com
  2013-07-30  4:39 ` [Bug libstdc++/58025] " whatmannerofburgeristhis at gmail dot com
  2013-07-30  4:44 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: whatmannerofburgeristhis at gmail dot com @ 2013-07-30  4:39 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58025
           Summary: Cannot use std::hash without setting off
                    -Wmismatched-tags
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: trivial
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: whatmannerofburgeristhis at gmail dot com

The headers inconsistently declare / forward declare std::hash using struct and
class, resulting in this warning when you try to use either. They should be
made to consistently use struct.

Testcase attached.

$ clang++ -std=c++11 -Wmismatched-tags -c libstdcpp_mismatched_tags_warning.cpp
-o /dev/null
libstdcpp_mismatched_tags_warning.cpp:42:5: warning: 'hash' defined as a struct
template here but
      previously declared as a class template [-Wmismatched-tags]
    struct hash<FooB>
    ^
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.8.1/../../../../include/c++/4.8.1/bits/stl_bvector.h:523:31:
note: 
      did you mean struct here?
    template<typename> friend class hash;
                              ^
libstdcpp_mismatched_tags_warning.cpp:51:5: warning: 'hash' defined as a class
template here but
      previously declared as a struct template [-Wmismatched-tags]
    class hash<FooA>
    ^
/usr/lib64/gcc/x86_64-unknown-linux-gnu/4.8.1/../../../../include/c++/4.8.1/bits/functional_hash.h:58:5:
note: 
      did you mean class here?
    struct hash;
    ^
2 warnings generated.


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

* [Bug libstdc++/58025] Cannot use std::hash without setting off -Wmismatched-tags
  2013-07-30  4:39 [Bug libstdc++/58025] New: Cannot use std::hash without setting off -Wmismatched-tags whatmannerofburgeristhis at gmail dot com
@ 2013-07-30  4:39 ` whatmannerofburgeristhis at gmail dot com
  2013-07-30  4:44 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: whatmannerofburgeristhis at gmail dot com @ 2013-07-30  4:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Matt Arsenault <whatmannerofburgeristhis at gmail dot com> ---
Created attachment 30570
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30570&action=edit
Testcase


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

* [Bug libstdc++/58025] Cannot use std::hash without setting off -Wmismatched-tags
  2013-07-30  4:39 [Bug libstdc++/58025] New: Cannot use std::hash without setting off -Wmismatched-tags whatmannerofburgeristhis at gmail dot com
  2013-07-30  4:39 ` [Bug libstdc++/58025] " whatmannerofburgeristhis at gmail dot com
@ 2013-07-30  4:44 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2013-07-30  4:44 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is one of the most questionable warnings that clang added.
>They should be made to consistently use struct.

No they don't have to be consistent at using struct vs class in standard C++.

*** This bug has been marked as a duplicate of bug 56627 ***


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

end of thread, other threads:[~2013-07-30  4:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-30  4:39 [Bug libstdc++/58025] New: Cannot use std::hash without setting off -Wmismatched-tags whatmannerofburgeristhis at gmail dot com
2013-07-30  4:39 ` [Bug libstdc++/58025] " whatmannerofburgeristhis at gmail dot com
2013-07-30  4:44 ` pinskia 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).