public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/50361] New: gcc 4.6 ICE probably relating to std::initializer_list and template argument deduction
@ 2011-09-12  5:49 delong.j at fb dot com
  2011-09-12  7:51 ` [Bug c++/50361] " redi at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: delong.j at fb dot com @ 2011-09-12  5:49 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50361
           Summary: gcc 4.6 ICE probably relating to std::initializer_list
                    and template argument deduction
    Classification: Unclassified
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: delong.j@fb.com


Created attachment 25243
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25243
preprocessed source output

Error is:

gcc_test/test.cpp: In function ‘int main()’:
gcc_test/test.cpp:67: 1: internal compiler error: in fold_convert_loc, at
fold-const.c:2028
Please submit a full bug report,
with preprocessed source if appropriate.

I was running into this in a fairly convoluted case, but pulled parts of it out
until I had a fairly minimal repro.

A hint here appears to be that if you define the constructors inside the class
instead of outside the class the ICE goes away.  Also removing the union member
removes the ICE.


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

* [Bug c++/50361] gcc 4.6 ICE probably relating to std::initializer_list and template argument deduction
  2011-09-12  5:49 [Bug c++/50361] New: gcc 4.6 ICE probably relating to std::initializer_list and template argument deduction delong.j at fb dot com
@ 2011-09-12  7:51 ` redi at gcc dot gnu.org
  2011-09-12 11:50 ` [Bug c++/50361] [C++0x] " paolo.carlini at oracle dot com
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu.org @ 2011-09-12  7:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-09-12 07:47:28 UTC ---
seems to be fixed on the 4.6 branch, but 4.7 gives a different ICE:
gcc_test/test.cpp:69:64: internal compiler error: in count_type_elements, at
expr.c:5310


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

* [Bug c++/50361] [C++0x] ICE probably relating to std::initializer_list and template argument deduction
  2011-09-12  5:49 [Bug c++/50361] New: gcc 4.6 ICE probably relating to std::initializer_list and template argument deduction delong.j at fb dot com
  2011-09-12  7:51 ` [Bug c++/50361] " redi at gcc dot gnu.org
@ 2011-09-12 11:50 ` paolo.carlini at oracle dot com
  2011-09-12 12:09 ` [Bug c++/50361] [C++0x] [4.7 Regression] " paolo.carlini at oracle dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-09-12 11:50 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|gcc 4.6 ICE probably        |[C++0x] ICE probably
                   |relating to                 |relating to
                   |std::initializer_list and   |std::initializer_list and
                   |template argument deduction |template argument deduction
           Severity|major                       |normal

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-09-12 10:59:54 UTC ---
Can you please try reducing it further? 402.1 KB is still unmanageable (Note:
I'm adding the C++0x marker, I suppose you are using -std=c++0x or
-std=gnu++0x, the info about the command line is missing)


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

* [Bug c++/50361] [C++0x] [4.7 Regression] ICE probably relating to std::initializer_list and template argument deduction
  2011-09-12  5:49 [Bug c++/50361] New: gcc 4.6 ICE probably relating to std::initializer_list and template argument deduction delong.j at fb dot com
  2011-09-12  7:51 ` [Bug c++/50361] " redi at gcc dot gnu.org
  2011-09-12 11:50 ` [Bug c++/50361] [C++0x] " paolo.carlini at oracle dot com
@ 2011-09-12 12:09 ` paolo.carlini at oracle dot com
  2011-09-12 12:16 ` [Bug c++/50361] [C++0x] [4.7 Regression] ICE with std::initializer_list nullptr paolo.carlini at oracle dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-09-12 12:09 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-09-12
                 CC|delong.j at fb dot com      |jason at gcc dot gnu.org
            Summary|[C++0x] ICE probably        |[C++0x] [4.7 Regression]
                   |relating to                 |ICE probably relating to
                   |std::initializer_list and   |std::initializer_list and
                   |template argument deduction |template argument deduction
     Ever Confirmed|0                           |1

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-09-12 11:50:33 UTC ---
Confirmed the mainline ICE.


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

* [Bug c++/50361] [C++0x] [4.7 Regression] ICE with std::initializer_list nullptr
  2011-09-12  5:49 [Bug c++/50361] New: gcc 4.6 ICE probably relating to std::initializer_list and template argument deduction delong.j at fb dot com
                   ` (2 preceding siblings ...)
  2011-09-12 12:09 ` [Bug c++/50361] [C++0x] [4.7 Regression] " paolo.carlini at oracle dot com
@ 2011-09-12 12:16 ` paolo.carlini at oracle dot com
  2011-09-12 19:46 ` [Bug c++/50361] [C++0x] [4.7 Regression] ICE with std::initializer_list and nullptr delong.j at fb dot com
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-09-12 12:16 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[C++0x] [4.7 Regression]    |[C++0x] [4.7 Regression]
                   |ICE probably relating to    |ICE with
                   |std::initializer_list and   |std::initializer_list
                   |template argument deduction |nullptr

--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-09-12 12:08:20 UTC ---
This is enough:

#include <initializer_list>

struct Foo
{
  Foo(std::initializer_list<Foo>) { };

  template<class T> Foo(T t) { T u(t); };

private:
  union Data
  {
    Data() : null(nullptr) {}

    std::nullptr_t null;
  } u_;
};

int main()
{
  Foo f = { {} };
}


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

* [Bug c++/50361] [C++0x] [4.7 Regression] ICE with std::initializer_list and nullptr
  2011-09-12  5:49 [Bug c++/50361] New: gcc 4.6 ICE probably relating to std::initializer_list and template argument deduction delong.j at fb dot com
                   ` (3 preceding siblings ...)
  2011-09-12 12:16 ` [Bug c++/50361] [C++0x] [4.7 Regression] ICE with std::initializer_list nullptr paolo.carlini at oracle dot com
@ 2011-09-12 19:46 ` delong.j at fb dot com
  2011-09-12 22:38 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: delong.j at fb dot com @ 2011-09-12 19:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jordan DeLong <delong.j at fb dot com> 2011-09-12 19:38:22 UTC ---
Ah, thanks Paolo.  That simplification also gave me enough hints for a
work-around for now.


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

* [Bug c++/50361] [C++0x] [4.7 Regression] ICE with std::initializer_list and nullptr
  2011-09-12  5:49 [Bug c++/50361] New: gcc 4.6 ICE probably relating to std::initializer_list and template argument deduction delong.j at fb dot com
                   ` (4 preceding siblings ...)
  2011-09-12 19:46 ` [Bug c++/50361] [C++0x] [4.7 Regression] ICE with std::initializer_list and nullptr delong.j at fb dot com
@ 2011-09-12 22:38 ` jason at gcc dot gnu.org
  2011-09-15 14:34 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2011-09-12 22:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |jason at gcc dot gnu.org
                   |gnu.org                     |


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

* [Bug c++/50361] [C++0x] [4.7 Regression] ICE with std::initializer_list and nullptr
  2011-09-12  5:49 [Bug c++/50361] New: gcc 4.6 ICE probably relating to std::initializer_list and template argument deduction delong.j at fb dot com
                   ` (5 preceding siblings ...)
  2011-09-12 22:38 ` jason at gcc dot gnu.org
@ 2011-09-15 14:34 ` jason at gcc dot gnu.org
  2011-09-15 15:39 ` jason at gcc dot gnu.org
  2011-09-16 20:32 ` delong.j at fb dot com
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2011-09-15 14:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2011-09-15 14:33:29 UTC ---
Author: jason
Date: Thu Sep 15 14:33:24 2011
New Revision: 178882

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178882
Log:
    PR c++/50361
    * expr.c (count_type_elements): Handle NULLPTR_TYPE.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/nullptr23.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/expr.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/50361] [C++0x] [4.7 Regression] ICE with std::initializer_list and nullptr
  2011-09-12  5:49 [Bug c++/50361] New: gcc 4.6 ICE probably relating to std::initializer_list and template argument deduction delong.j at fb dot com
                   ` (6 preceding siblings ...)
  2011-09-15 14:34 ` jason at gcc dot gnu.org
@ 2011-09-15 15:39 ` jason at gcc dot gnu.org
  2011-09-16 20:32 ` delong.j at fb dot com
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2011-09-15 15:39 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> 2011-09-15 14:34:21 UTC ---
Fixed.


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

* [Bug c++/50361] [C++0x] [4.7 Regression] ICE with std::initializer_list and nullptr
  2011-09-12  5:49 [Bug c++/50361] New: gcc 4.6 ICE probably relating to std::initializer_list and template argument deduction delong.j at fb dot com
                   ` (7 preceding siblings ...)
  2011-09-15 15:39 ` jason at gcc dot gnu.org
@ 2011-09-16 20:32 ` delong.j at fb dot com
  8 siblings, 0 replies; 10+ messages in thread
From: delong.j at fb dot com @ 2011-09-16 20:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Jordan DeLong <delong.j at fb dot com> 2011-09-16 20:12:43 UTC ---
Thanks!


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

end of thread, other threads:[~2011-09-16 20:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-12  5:49 [Bug c++/50361] New: gcc 4.6 ICE probably relating to std::initializer_list and template argument deduction delong.j at fb dot com
2011-09-12  7:51 ` [Bug c++/50361] " redi at gcc dot gnu.org
2011-09-12 11:50 ` [Bug c++/50361] [C++0x] " paolo.carlini at oracle dot com
2011-09-12 12:09 ` [Bug c++/50361] [C++0x] [4.7 Regression] " paolo.carlini at oracle dot com
2011-09-12 12:16 ` [Bug c++/50361] [C++0x] [4.7 Regression] ICE with std::initializer_list nullptr paolo.carlini at oracle dot com
2011-09-12 19:46 ` [Bug c++/50361] [C++0x] [4.7 Regression] ICE with std::initializer_list and nullptr delong.j at fb dot com
2011-09-12 22:38 ` jason at gcc dot gnu.org
2011-09-15 14:34 ` jason at gcc dot gnu.org
2011-09-15 15:39 ` jason at gcc dot gnu.org
2011-09-16 20:32 ` delong.j at fb dot com

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