public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/45908] New: ICE involving decltype: in tree_low_cst, at tree.h:4114
@ 2010-10-06  2:56 tom.prince at ualberta dot net
  2010-10-06 10:16 ` [Bug c++/45908] [C++0x] " redi at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: tom.prince at ualberta dot net @ 2010-10-06  2:56 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: ICE involving decltype: in tree_low_cst, at
                    tree.h:4114
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tom.prince@ualberta.net


Created attachment 21968
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=21968
failing file

g++-4.6.0-alpha20100925 -std=c++0x -c test.cc
test.cc:7:50: internal compiler error: in tree_low_cst, at tree.h:4114

also:

g++-4.6.0-alpha20100925 -std=c++0x -c test2.cc
test.cc:6:33: error: 'statements' was not declared in this scope
test.cc:6:33: error: 'statements' was not declared in this scope


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

* [Bug c++/45908] [C++0x] ICE involving decltype: in tree_low_cst, at tree.h:4114
  2010-10-06  2:56 [Bug c++/45908] New: ICE involving decltype: in tree_low_cst, at tree.h:4114 tom.prince at ualberta dot net
@ 2010-10-06 10:16 ` redi at gcc dot gnu.org
  2010-10-06 10:37 ` redi at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2010-10-06 10:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2010.10.06 10:15:52
     Ever Confirmed|0                           |1

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2010-10-06 10:15:52 UTC ---
first testcase reduced:

struct vector {
    struct iterator { };
    struct const_iterator { };
    iterator begin();
    const_iterator begin() const;
};

class block {
        vector v;
        auto end() const -> decltype(v.begin()) { return v.begin(); }
};


4.5 doesn't ICE but gives an error here (because 'this' isn't const in the late
return type)


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

* [Bug c++/45908] [C++0x] ICE involving decltype: in tree_low_cst, at tree.h:4114
  2010-10-06  2:56 [Bug c++/45908] New: ICE involving decltype: in tree_low_cst, at tree.h:4114 tom.prince at ualberta dot net
  2010-10-06 10:16 ` [Bug c++/45908] [C++0x] " redi at gcc dot gnu.org
@ 2010-10-06 10:37 ` redi at gcc dot gnu.org
  2010-10-06 13:19 ` hjl.tools at gmail dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2010-10-06 10:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2010-10-06 10:37:19 UTC ---
The second testcase is a different issue which can be reduced to:

class block {
        auto f() const -> decltype(i);
        int i;
};

name lookup in the member function's  trailing-return-type does not find
members of the enclosing class which have not been declared yet
(additionally, the diagnostic is given twice)

I think that's wrong because the trailing-return-type follows the function's
declarator-id, so [basic.lookup.unqual]p8 applies, but I'll leave Jason to
clarify that


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

* [Bug c++/45908] [C++0x] ICE involving decltype: in tree_low_cst, at tree.h:4114
  2010-10-06  2:56 [Bug c++/45908] New: ICE involving decltype: in tree_low_cst, at tree.h:4114 tom.prince at ualberta dot net
  2010-10-06 10:16 ` [Bug c++/45908] [C++0x] " redi at gcc dot gnu.org
  2010-10-06 10:37 ` redi at gcc dot gnu.org
@ 2010-10-06 13:19 ` hjl.tools at gmail dot com
  2010-10-06 14:00 ` jason at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2010-10-06 13:19 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot
                   |                            |gnu.org

--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> 2010-10-06 13:19:05 UTC ---
The first testcase is caused by revision 159800:

http://gcc.gnu.org/ml/gcc-cvs/2010-05/msg00854.html


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

* [Bug c++/45908] [C++0x] ICE involving decltype: in tree_low_cst, at tree.h:4114
  2010-10-06  2:56 [Bug c++/45908] New: ICE involving decltype: in tree_low_cst, at tree.h:4114 tom.prince at ualberta dot net
                   ` (2 preceding siblings ...)
  2010-10-06 13:19 ` hjl.tools at gmail dot com
@ 2010-10-06 14:00 ` jason at gcc dot gnu.org
  2010-10-06 14:35 ` ebotcazou at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2010-10-06 14:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2010-10-06 14:00:11 UTC ---
(In reply to comment #3)
> I think that's wrong because the trailing-return-type follows the function's
> declarator-id, so [basic.lookup.unqual]p8 applies, but I'll leave Jason to
> clarify that

But paragraph 7 also applies (name used in a class outside a member function
body), so the name needs to be declared before its use.


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

* [Bug c++/45908] [C++0x] ICE involving decltype: in tree_low_cst, at tree.h:4114
  2010-10-06  2:56 [Bug c++/45908] New: ICE involving decltype: in tree_low_cst, at tree.h:4114 tom.prince at ualberta dot net
                   ` (3 preceding siblings ...)
  2010-10-06 14:00 ` jason at gcc dot gnu.org
@ 2010-10-06 14:35 ` ebotcazou at gcc dot gnu.org
  2010-10-06 14:46 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2010-10-06 14:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2010-10-06 14:35:33 UTC ---
Author: ebotcazou
Date: Wed Oct  6 14:35:25 2010
New Revision: 165031

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=165031
Log:
    PR c++/45908
    * typeck.c (cp_build_addr_expr_1): Add check for incomplete types in
    code folding offsetof-like computations.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/pr45908.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/typeck.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/45908] [C++0x] ICE involving decltype: in tree_low_cst, at tree.h:4114
  2010-10-06  2:56 [Bug c++/45908] New: ICE involving decltype: in tree_low_cst, at tree.h:4114 tom.prince at ualberta dot net
                   ` (4 preceding siblings ...)
  2010-10-06 14:35 ` ebotcazou at gcc dot gnu.org
@ 2010-10-06 14:46 ` redi at gcc dot gnu.org
  2010-10-06 17:37 ` jason at gcc dot gnu.org
  2010-11-02 16:38 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2010-10-06 14:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> 2010-10-06 14:45:53 UTC ---
(In reply to comment #5)
> But paragraph 7 also applies (name used in a class outside a member function
> body), so the name needs to be declared before its use.

thanks, I missed that. So the testcase in comment 3 is invalid (I'll open a new
PR for the dup diagnostic)

re comment 2, is 4.5 correct to use a non-const access path to v.begin() in the
trailing-return-type?


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

* [Bug c++/45908] [C++0x] ICE involving decltype: in tree_low_cst, at tree.h:4114
  2010-10-06  2:56 [Bug c++/45908] New: ICE involving decltype: in tree_low_cst, at tree.h:4114 tom.prince at ualberta dot net
                   ` (5 preceding siblings ...)
  2010-10-06 14:46 ` redi at gcc dot gnu.org
@ 2010-10-06 17:37 ` jason at gcc dot gnu.org
  2010-11-02 16:38 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2010-10-06 17:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> 2010-10-06 17:37:32 UTC ---
(In reply to comment #7)
> re comment 2, is 4.5 correct to use a non-const access path to v.begin() in the
> trailing-return-type?

Yes.  The trailing-return-type is not in the context of the function, so 'v' is
not based on 'this'.  I'll raise this as an issue with the committee.


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

* [Bug c++/45908] [C++0x] ICE involving decltype: in tree_low_cst, at tree.h:4114
  2010-10-06  2:56 [Bug c++/45908] New: ICE involving decltype: in tree_low_cst, at tree.h:4114 tom.prince at ualberta dot net
                   ` (6 preceding siblings ...)
  2010-10-06 17:37 ` jason at gcc dot gnu.org
@ 2010-11-02 16:38 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2010-11-02 16:38 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #9 from Jason Merrill <jason at gcc dot gnu.org> 2010-11-02 16:38:03 UTC ---
The ICE is fixed.


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

end of thread, other threads:[~2010-11-02 16:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-06  2:56 [Bug c++/45908] New: ICE involving decltype: in tree_low_cst, at tree.h:4114 tom.prince at ualberta dot net
2010-10-06 10:16 ` [Bug c++/45908] [C++0x] " redi at gcc dot gnu.org
2010-10-06 10:37 ` redi at gcc dot gnu.org
2010-10-06 13:19 ` hjl.tools at gmail dot com
2010-10-06 14:00 ` jason at gcc dot gnu.org
2010-10-06 14:35 ` ebotcazou at gcc dot gnu.org
2010-10-06 14:46 ` redi at gcc dot gnu.org
2010-10-06 17:37 ` jason at gcc dot gnu.org
2010-11-02 16:38 ` jason 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).