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

* [Bug libstdc++/59712] unordered_map : clang fails with "member access into incomplete type"
  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 ` pinskia at gcc dot gnu.org
  2014-01-07 19:39 ` oparcollet.triqs at gmail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-01-07 19:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Are you sure this is not a clang issue?


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

* [Bug libstdc++/59712] unordered_map : clang fails with "member access into incomplete type"
  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
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: oparcollet.triqs at gmail dot com @ 2014-01-07 19:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Olivier Parcollet <oparcollet.triqs at gmail dot com> ---
I am not sure.

If I understood correctly, clang is stricter on this sort of issue than gcc,
but I do not know what the standard says.

A minimal version of such code is (from hashtable.h) : 

#include <utility>

template<typename T> class A {
 int f(int i) const noexcept { return i + 1; }
 static_assert(noexcept(std::declval<const A&>().f(0)),"bla bla");
};

int main() {
 A<int> a;
}

again gcc compiles it, not clang (same error as before).

Which one is right ?
(even though I don't really see the point of this static_assert in the first
place...).


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

* [Bug libstdc++/59712] unordered_map : clang fails with "member access into incomplete type"
  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
  4 siblings, 0 replies; 6+ messages in thread
From: fdumont at gcc dot gnu.org @ 2014-01-08 21:18 UTC (permalink / raw)
  To: gcc-bugs

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

François Dumont <fdumont at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fdumont at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |fdumont at gcc dot gnu.org

--- Comment #4 from François Dumont <fdumont at gcc dot gnu.org> ---
This assertion purpose is documented. _Hashtable can be used itself and this
assertion (and the others) are making sure that the types used to instantiate
it are following a number of rules.

We could perform the static assertion on the type that is hosting the tested
method, I will prepare a patch for that.
>From gcc-bugs-return-439704-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jan 08 21:31:11 2014
Return-Path: <gcc-bugs-return-439704-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 11135 invoked by alias); 8 Jan 2014 21:31:10 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 11093 invoked by uid 48); 8 Jan 2014 21:31:05 -0000
From: "sje at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug plugins/59335] Plugin doesn't build on trunk
Date: Wed, 08 Jan 2014 21:31:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: plugins
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: sje at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on cc everconfirmed
Message-ID: <bug-59335-4-cZUnDiw45R@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59335-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59335-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-01/txt/msg00846.txt.bz2
Content-length: 468

http://gcc.gnu.org/bugzilla/show_bug.cgi?idY335

Steve Ellcey <sje at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-01-08
                 CC|                            |sje at gcc dot gnu.org
     Ever confirmed|0                           |1


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

* [Bug libstdc++/59712] unordered_map : clang fails with "member access into incomplete type"
  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
                   ` (2 preceding siblings ...)
  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
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2014-01-08 21:44 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2014-01-08
     Ever confirmed|0                           |1

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Thanks, François
>From gcc-bugs-return-439706-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jan 08 22:09:40 2014
Return-Path: <gcc-bugs-return-439706-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 8991 invoked by alias); 8 Jan 2014 22:09:39 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 8968 invoked by uid 48); 8 Jan 2014 22:09:34 -0000
From: "michael.hudson at linaro dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libgcc/59714] complex division is surprising on aarch64
Date: Wed, 08 Jan 2014 22:09:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libgcc
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: michael.hudson at linaro dot org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-59714-4-oDlU9CRhSJ@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59714-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59714-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-01/txt/msg00848.txt.bz2
Content-length: 728

http://gcc.gnu.org/bugzilla/show_bug.cgi?idY714

--- Comment #4 from Michael Hudson-Doyle <michael.hudson at linaro dot org> ---
OK, so I should stop talking about accurate and instead talk about surprising
:-)

I think it is pretty surprising that x/x != 1+0i for (I think) all x where the
ratio between the real and imaginary parts is not a power of 2 (put another
way, an error of 1ulp when the accurate result is 0 is more surprising than
when the accurate result is non-zero).

In general, fma makes it hard to reason about expressions like "a*b-c*d" --
which of the multiplications is being done at the higher precision?  But I
guess arguing to fp-contract to default to off is a war I don't want to get
into fighting.


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

* [Bug libstdc++/59712] unordered_map : clang fails with "member access into incomplete type"
  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
                   ` (3 preceding siblings ...)
  2014-01-08 21:44 ` redi at gcc dot gnu.org
@ 2014-01-16 11:59 ` redi at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2014-01-16 11:59 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|unknown                     |4.9.0
   Target Milestone|---                         |4.9.0


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