public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/59712] New: unordered_map : clang fails with "member access into incomplete type"
@ 2014-01-07 19:01 oparcollet.triqs at gmail dot com
  2014-01-07 19:18 ` [Bug libstdc++/59712] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: oparcollet.triqs at gmail dot com @ 2014-01-07 19:01 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59712
           Summary: unordered_map : clang fails with "member access into
                    incomplete type"
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: oparcollet.triqs at gmail dot com

The code : 

#include <unordered_map>
int main() {
 std::unordered_map<int,int> M;
}

using : 
- libstdc++ of gcc 4.9.0, svn r206386. 
- clang3.4, -std=c++11 mode
- Ubuntu 12.04

fails with clang (while it compiles with gcc 4.9.0) due to 
a member access into one incomplete type in a template...

If one comments this static_assert in the hashtable.h:267, clang compiles the
code correctly.

Error : 

LAB:~/C++ $ ~/CLANG/install/bin/clang++ -std=c++11 bug_hash_clang1y.cpp 
In file included from bug_hash_clang1y.cpp:1:
In file included from
/home/..../gcc4.9/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../include/c++/4.9.0/unordered_map:47:
/home/.../gcc4.9/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../include/c++/4.9.0/bits/hashtable.h:267:9:
error: member access into
      incomplete type 'const std::_Hashtable<int, std::pair<const int, int>,
std::allocator<std::pair<const int, int> >,
      std::__detail::_Select1st, std::equal_to<int>, std::hash<int>,
std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash,
      std::__detail::_Prime_rehash_policy,
std::__detail::_Hashtable_traits<false, false, true> >'
                             ._M_bucket_index((const __node_type*)nullptr,
                             ^
/home/.../gcc4.9/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../include/c++/4.9.0/bits/unordered_map.h:101:18:
note: in instantiation
      of template class 'std::_Hashtable<int, std::pair<const int, int>,
std::allocator<std::pair<const int, int> >,
      std::__detail::_Select1st, std::equal_to<int>, std::hash<int>,
std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash,
      std::__detail::_Prime_rehash_policy,
std::__detail::_Hashtable_traits<false, false, true> >' requested here
      _Hashtable _M_h;
                 ^
bug_hash_clang1y.cpp:3:30: note: in instantiation of template class
'std::unordered_map<int, int, std::hash<int>, std::equal_to<int>,
      std::allocator<std::pair<const int, int> > >' requested here
 std::unordered_map<int,int> M;
                             ^
/home/..../gcc4.9/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../include/c++/4.9.0/bits/hashtable.h:174:11:
note: definition of
      'std::_Hashtable<int, std::pair<const int, int>,
std::allocator<std::pair<const int, int> >, std::__detail::_Select1st,
      std::equal_to<int>, std::hash<int>, std::__detail::_Mod_range_hashing,
std::__detail::_Default_ranged_hash,
      std::__detail::_Prime_rehash_policy,
std::__detail::_Hashtable_traits<false, false, true> >' is not complete until
the closing '}'
    class _Hashtable
          ^
1 error generated.


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

end of thread, other threads:[~2014-01-16 11:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-07 19:01 [Bug libstdc++/59712] New: unordered_map : clang fails with "member access into incomplete type" oparcollet.triqs at gmail dot com
2014-01-07 19:18 ` [Bug libstdc++/59712] " pinskia at gcc dot gnu.org
2014-01-07 19:39 ` oparcollet.triqs at gmail dot com
2014-01-08 21:18 ` fdumont at gcc dot gnu.org
2014-01-08 21:44 ` redi at gcc dot gnu.org
2014-01-16 11:59 ` redi 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).