[Bug 1352356] Re: [C++0x] Internal compiler error when using initializer lists

Bug Watch Updater 1352356 at bugs.launchpad.net
Mon Aug 4 14:49:03 UTC 2014


Launchpad has imported 9 comments from the remote bug at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50478.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2011-09-22T06:39:46+00:00 Bitti wrote:

The following short program shows the problem:

#include <set>
#include <string>

int main() {
    std::set<std::string> s;
    s.insert( {"abc", "def", "hij"} ); // This line is the problem
}

> g++ -std=c++0x test.cc
test.cc: In function ‘int main()’:
test.cc:6:37: internal compiler error: in joust, at cp/call.c:7646

If I compile with -pedantic, the program compiles fine.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.6/+bug/1352356/comments/0

------------------------------------------------------------------------
On 2011-09-22T07:19:17+00:00 Daniel-kruegler wrote:

The problem seem to exist in 4.7.0 20110917 (experimental) as well, pointing to
joust, at cp/call.c:7960.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.6/+bug/1352356/comments/1

------------------------------------------------------------------------
On 2011-12-21T11:17:10+00:00 Paolo-carlini wrote:

Insane, this doesn't happen for an initializer list of 1, 2, 4, or 5
elements. Happens with std::vector too, however. Should be rather easy
to construct a reduced testcase including only <string>.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.6/+bug/1352356/comments/2

------------------------------------------------------------------------
On 2011-12-21T12:20:43+00:00 Paolo-carlini wrote:

This is enough:

namespace std
{
  template<class _E>
    class initializer_list;

  template<typename _Key>
    struct set
    {
      void insert(const _Key&);
    };

  struct string
  {
    string(const string&, __SIZE_TYPE__, __SIZE_TYPE__ = -1);
    string(const char*);
    string(initializer_list<char>);
  };
}

int main()
{
  std::set<std::string> s;
  s.insert( { "abc", "def", "hij"} );
}

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.6/+bug/1352356/comments/3

------------------------------------------------------------------------
On 2011-12-21T12:43:38+00:00 Paolo-carlini wrote:

This is a more correct testcase, which also preserves the property of OT
that -pedantic works around the issue. Note: removing the string
constructor taking an initializer_list also works around the problem:

///////////////////

#include <initializer_list>

namespace std
{
  template<typename _Key>
    struct set
    {
      void insert(const _Key&);
      void insert(initializer_list<_Key>);
    };

  struct string
  {
    string(const string&, __SIZE_TYPE__, __SIZE_TYPE__ = -1);
    string(const char*);
    string(initializer_list<char>);
  };
}

int main()
{
  std::set<std::string> s;
  s.insert( { "abc", "def", "hij"} );
}

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.6/+bug/1352356/comments/4

------------------------------------------------------------------------
On 2012-04-18T10:35:59+00:00 Paolo-carlini wrote:

Seems fixed in mainline.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.6/+bug/1352356/comments/5

------------------------------------------------------------------------
On 2012-10-10T09:01:21+00:00 Paolo-carlini wrote:

Fixed in 4.7.1 and mainline. Let's add the testcase and close the PR.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.6/+bug/1352356/comments/6

------------------------------------------------------------------------
On 2012-10-10T09:12:28+00:00 Paolo-k wrote:

Author: paolo
Date: Wed Oct 10 09:12:19 2012
New Revision: 192295

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192295
Log:
2012-10-10  Paolo Carlini  <paolo.carlini at oracle.com>

	PR c++/50478
	* g++.dg/cpp0x/initlist67.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/initlist67.C
Modified:
    trunk/gcc/testsuite/ChangeLog

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.6/+bug/1352356/comments/7

------------------------------------------------------------------------
On 2012-10-10T09:13:12+00:00 Paolo-carlini wrote:

Done.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.6/+bug/1352356/comments/8


** Changed in: gcc
       Status: Unknown => Fix Released

** Changed in: gcc
   Importance: Unknown => Medium

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-4.6 in Ubuntu.
https://bugs.launchpad.net/bugs/1352356

Title:
   [C++0x] Internal compiler error when using initializer lists

Status in FEniCS Project:
  New
Status in The GNU Compiler Collection:
  Fix Released
Status in “gcc-4.6” package in Ubuntu:
  Confirmed

Bug description:
  From https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50478
   Matti Rintala 2011-09-22 06:39:46 UTC

  The following short program shows the problem:

  #include <set>
  #include <string>

  int main() {
      std::set<std::string> s;
      s.insert( {"abc", "def", "hij"} ); // This line is the problem
  }

  > g++ -std=c++0x test.cc
  test.cc: In function ‘int main()’:
  test.cc:6:37: internal compiler error: in joust, at cp/call.c:7646

  If I compile with -pedantic, the program compiles fine.

To manage notifications about this bug go to:
https://bugs.launchpad.net/fenics/+bug/1352356/+subscriptions



More information about the foundations-bugs mailing list