public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "oparcollet.triqs at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/59712] New: unordered_map : clang fails with "member access into incomplete type"
Date: Tue, 07 Jan 2014 19:01:00 -0000	[thread overview]
Message-ID: <bug-59712-4@http.gcc.gnu.org/bugzilla/> (raw)

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.


             reply	other threads:[~2014-01-07 19:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-07 19:01 oparcollet.triqs at gmail dot com [this message]
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

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