This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/58025] New: Cannot use std::hash without setting off -Wmismatched-tags


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]