public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57196] New: [4.8 regression] Bogus "aggregate ... has incomplete type and cannot be defined"
@ 2013-05-07 19:58 ppluzhnikov at google dot com
  2013-05-07 20:52 ` [Bug c++/57196] " daniel.kruegler at googlemail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: ppluzhnikov at google dot com @ 2013-05-07 19:58 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 57196
           Summary: [4.8 regression] Bogus "aggregate ... has incomplete
                    type and cannot be defined"
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ppluzhnikov@google.com


Google ref: b/8853908

Test case reduced from gUnit.

#include <set>
#include <string>

using std::set;
using std::string;

int& IsNullLiteralHelper(...);

template <size_t> struct EqHelper { };

void Fn() {
  EqHelper<sizeof IsNullLiteralHelper(set<int>{1})>        eq1;  // ok
  EqHelper<sizeof IsNullLiteralHelper(set<string>())>      eq2;  // ok
  EqHelper<sizeof IsNullLiteralHelper(set<string>{"foo"})> eq3;  // error
}


Using trunk built at r198689:


g++  -std=c++11 -c tt.cc
tt.cc: In function ‘void Fn()’:
tt.cc:14:60: error: aggregate ‘EqHelper<sizeof
(IsNullLiteralHelper(std::set<std::basic_string<char>
>(std::initializer_list<std::basic_string<char> >{((const
std::basic_string<char>*)(& const std::basic_string<char>
[1]{std::basic_string<char>(((const char*)"foo"), (*(const
std::allocator<char>*)(& std::allocator<char>())))})), 1u}, (*(const
std::less<std::basic_string<char> >*)(& std::less<std::basic_string<char>
>())), (*(const std::allocator<std::basic_string<char> >*)(&
std::allocator<std::basic_string<char> >())))))> eq3’ has incomplete type and
cannot be defined
   EqHelper<sizeof IsNullLiteralHelper(set<string>{"foo"})> eq3;
                                                            ^
>From gcc-bugs-return-421775-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue May 07 20:11:15 2013
Return-Path: <gcc-bugs-return-421775-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 7076 invoked by alias); 7 May 2013 20:11:15 -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 7023 invoked by uid 48); 7 May 2013 20:11:10 -0000
From: "wschmidt at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/57192] [4.9 Regression] miscompilation at -O3
Date: Tue, 07 May 2013 20:11:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: wschmidt at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Changed-Fields: Status CC Resolution
Message-ID: <bug-57192-4-T9dfzam3oA@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57192-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57192-4@http.gcc.gnu.org/bugzilla/>
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
Content-Type: text/plain; charset="UTF-8"
MIME-Version: 1.0
X-SW-Source: 2013-05/txt/msg00448.txt.bz2
Content-length: 796


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

Bill Schmidt <wschmidt at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |wschmidt at gcc dot gnu.org
         Resolution|                            |FIXED

--- Comment #6 from Bill Schmidt <wschmidt at gcc dot gnu.org> 2013-05-07 20:11:09 UTC ---
OK, thanks!  Current trunk has a half-good fix that I put in this morning.  The
proposed patch fixes it the right way.  Good to hear that both versions appear
to solve this problem!

Closing as resolved.  Please feel free to re-open if the problem comes back.


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

* [Bug c++/57196] [4.8 regression] Bogus "aggregate ... has incomplete type and cannot be defined"
  2013-05-07 19:58 [Bug c++/57196] New: [4.8 regression] Bogus "aggregate ... has incomplete type and cannot be defined" ppluzhnikov at google dot com
@ 2013-05-07 20:52 ` daniel.kruegler at googlemail dot com
  2013-05-10 14:32 ` jason at gcc dot gnu.org
  2013-05-13 19:34 ` jason at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2013-05-07 20:52 UTC (permalink / raw)
  To: gcc-bugs


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

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler at
                   |                            |googlemail dot com

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2013-05-07 20:52:28 UTC ---
Here a more simplified version that reproduces the problem:

//---------------------------------------
#include <initializer_list>

template<class T>
struct set {
  set() = default;
  set(std::initializer_list<T>){}
};

struct string {
  string(const char*){}
  ~string(){}
};

typedef decltype(sizeof(0)) size_t;

template <size_t> struct EqHelper { };

int IsNullLiteralHelper(...);

void Fn() {
  EqHelper<sizeof IsNullLiteralHelper(set<int>{1})>        eq1;  // ok
  EqHelper<sizeof IsNullLiteralHelper(set<string>())>      eq2;  // ok
  EqHelper<sizeof IsNullLiteralHelper(set<string>{"foo"})> eq3;  // error
}
//---------------------------------------

It seems to be relevant that string has a non-trivial destructor and that set
has an initializer-list constructor (When e.g. replacing
set(std::initializer_list<T>){} by set(T){} causes the code to be accepted)
>From gcc-bugs-return-421778-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue May 07 21:27:48 2013
Return-Path: <gcc-bugs-return-421778-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 23027 invoked by alias); 7 May 2013 21:27:48 -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 22999 invoked by uid 48); 7 May 2013 21:27:44 -0000
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/57197] New: [Fortran-Dev][Regression] ICE in record_reference, at cgraphbuild.c:66
Date: Tue, 07 May 2013 21:27:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: burnus at gcc dot gnu.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-Changed-Fields:
Message-ID: <bug-57197-4@http.gcc.gnu.org/bugzilla/>
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
Content-Type: text/plain; charset="UTF-8"
MIME-Version: 1.0
X-SW-Source: 2013-05/txt/msg00451.txt.bz2
Content-length: 1229


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

             Bug #: 57197
           Summary: [Fortran-Dev][Regression] ICE in record_reference, at
                    cgraphbuild.c:66
    Classification: Unclassified
           Product: gcc
           Version: fortran-dev
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


The example from bug 45170 comment 41 fails with an ICE on Fortran-Dev
  internal compiler error: in record_reference, at cgraphbuild.c:66

It works with GCC 4.8/4.9


module thing
    implicit none
    character(len=:), allocatable :: array_of_chars(:)
    contains

      subroutine allocatestuff()
        implicit none
        integer :: length_names = 15
        integer :: number_arrays  = 5

        allocate(character(15) :: array_of_chars(number_arrays))
        !allocate(character(length_names) :: array_of_chars(number_arrays))

      end subroutine allocatestuff

end module thing

program test1
implicit none


      call allocatestuff()

end program test1


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

* [Bug c++/57196] [4.8 regression] Bogus "aggregate ... has incomplete type and cannot be defined"
  2013-05-07 19:58 [Bug c++/57196] New: [4.8 regression] Bogus "aggregate ... has incomplete type and cannot be defined" ppluzhnikov at google dot com
  2013-05-07 20:52 ` [Bug c++/57196] " daniel.kruegler at googlemail dot com
@ 2013-05-10 14:32 ` jason at gcc dot gnu.org
  2013-05-13 19:34 ` jason at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jason at gcc dot gnu.org @ 2013-05-10 14:32 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2013-05-10
                 CC|                            |jason at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |jason at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for 4.9 so far (r198778).


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

* [Bug c++/57196] [4.8 regression] Bogus "aggregate ... has incomplete type and cannot be defined"
  2013-05-07 19:58 [Bug c++/57196] New: [4.8 regression] Bogus "aggregate ... has incomplete type and cannot be defined" ppluzhnikov at google dot com
  2013-05-07 20:52 ` [Bug c++/57196] " daniel.kruegler at googlemail dot com
  2013-05-10 14:32 ` jason at gcc dot gnu.org
@ 2013-05-13 19:34 ` jason at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jason at gcc dot gnu.org @ 2013-05-13 19:34 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |4.8.1

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for 4.8.1 as well.


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

end of thread, other threads:[~2013-05-13 19:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-07 19:58 [Bug c++/57196] New: [4.8 regression] Bogus "aggregate ... has incomplete type and cannot be defined" ppluzhnikov at google dot com
2013-05-07 20:52 ` [Bug c++/57196] " daniel.kruegler at googlemail dot com
2013-05-10 14:32 ` jason at gcc dot gnu.org
2013-05-13 19:34 ` 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).