public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jasongross9+bugzilla at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/55365] New: internal compiler error: in process_init_constructor_union, at cp/typeck2.c:1335; internal compiler error: in lookup_field_1, at cp/search.c:387; internal compiler error: in process_init_constructor_record, at cp/typeck2.c:1189
Date: Sat, 17 Nov 2012 15:39:00 -0000	[thread overview]
Message-ID: <bug-55365-4@http.gcc.gnu.org/bugzilla/> (raw)


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

             Bug #: 55365
           Summary: internal compiler error: in
                    process_init_constructor_union, at cp/typeck2.c:1335;
                    internal compiler error: in lookup_field_1, at
                    cp/search.c:387; internal compiler error: in
                    process_init_constructor_record, at cp/typeck2.c:1189
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jasongross9+bugzilla@gmail.com


$ /afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/g++ -std=c++11 -c
free_list.cpp  -v -save-temps
Using built-in specs.
COLLECT_GCC=/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/g++
Target: x86_64-unknown-linux-gnu
Configured with: ./configure
--prefix=/afs/csail/proj/courses/6.172/gcc-cilkplus --enable-languages=c,c++
Thread model: posix
gcc version 4.8.0 20120618 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-std=c++11' '-c' '-v' '-save-temps' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'

/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/cc1plus
-E -quiet -v -iprefix
/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/
-D_GNU_SOURCE free_list.cpp -mtune=generic -march=x86-64 -std=c++11
-fpch-preprocess -o free_list.ii
ignoring nonexistent directory
"/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../x86_64-unknown-linux-gnu/include"
ignoring duplicate directory
"/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0"
ignoring duplicate directory
"/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0/x86_64-unknown-linux-gnu"
ignoring duplicate directory
"/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0/backward"
ignoring duplicate directory
"/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include"
ignoring duplicate directory
"/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include-fixed"
ignoring nonexistent directory
"/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/intel/composer_xe_2013.0.079/mkl/include
 /opt/intel/composer_xe_2013.0.079/tbb/include

/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0

/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0/x86_64-unknown-linux-gnu

/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0/backward

/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include

/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include-fixed
 /usr/local/include

/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/../../include
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-std=c++11' '-c' '-v' '-save-temps' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'

/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/cc1plus
-fpreprocessed free_list.ii -quiet -dumpbase free_list.cpp -mtune=generic
-march=x86-64 -auxbase free_list -std=c++11 -version -o free_list.s
GNU C++ (GCC) version 4.8.0 20120618 (experimental) (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.8.0 20120618 (experimental), GMP version
5.0.2, MPFR version 3.1.0, MPC version 0.9
warning: GMP header version 5.0.2 differs from library version 4.3.2.
warning: MPFR header version 3.1.0 differs from library version 3.0.0-p3.
warning: MPC header version 0.9 differs from library version 0.8.2.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C++ (GCC) version 4.8.0 20120618 (experimental) (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.8.0 20120618 (experimental), GMP version
5.0.2, MPFR version 3.1.0, MPC version 0.9
warning: GMP header version 5.0.2 differs from library version 4.3.2.
warning: MPFR header version 3.1.0 differs from library version 3.0.0-p3.
warning: MPC header version 0.9 differs from library version 0.8.2.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 9140df29c77763bd28b47359117a6952
free_list.cpp: In instantiation of ‘Foo<T>::Foo(T&&) [with T = Bar]’:
free_list.cpp:23:37:   required from here
free_list.cpp:13:23: error: ‘b’ was not declared in this scope
       : _data{ .b = c } { }
                       ^
free_list.cpp:13:23: internal compiler error: in
process_init_constructor_union, at cp/typeck2.c:1335
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ cat free_list.ii
# 1 "free_list.cpp"
# 1 "<command-line>"
# 1 "free_list.cpp"
template <typename T>
class Foo {
 private:
  union arr_or_b {
    T b;
    char arr[];
  };

  arr_or_b _data;

 public:
  Foo(T &&c)
      : _data{ .b = c } { }
};

struct Bar;

struct Bar {
  Foo<Bar> *foo;
};

void quz() {
  Foo<Bar> *foo = new Foo<Bar>(Bar());
}




If I replace "      : _data{ .b = c } { }" with "      : _data({ .b = c }) {
}", I get "internal compiler error: in lookup_field_1, at cp/search.c:387".  If
I replace it with "      : _data{{ .b = c }} { }" instead, I get "internal
compiler error: in process_init_constructor_record, at cp/typeck2.c:1189".


             reply	other threads:[~2012-11-17 15:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-17 15:39 jasongross9+bugzilla at gmail dot com [this message]
2012-11-17 16:05 ` [Bug c++/55365] " jasongross9+bugzilla at gmail dot com
2012-11-17 16:10 ` jasongross9+bugzilla at gmail dot com
2012-11-17 23:18 ` paolo.carlini at oracle dot com
2013-05-14 14:55 ` [Bug c++/55365] ICE in process_init_constructor_union, at cp/typeck2.c:1335 jason at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-55365-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).