public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "whatmannerofburgeristhis at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/58025] New: Cannot use std::hash without setting off -Wmismatched-tags
Date: Tue, 30 Jul 2013 04:39:00 -0000	[thread overview]
Message-ID: <bug-58025-4@http.gcc.gnu.org/bugzilla/> (raw)

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.


             reply	other threads:[~2013-07-30  4:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-30  4:39 whatmannerofburgeristhis at gmail dot com [this message]
2013-07-30  4:39 ` [Bug libstdc++/58025] " whatmannerofburgeristhis at gmail dot com
2013-07-30  4:44 ` pinskia 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-58025-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).