public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51265] New: internal compiler error: in finish_decltype_type, at cp/semantics.c:5244
@ 2011-11-22  8:05 i.nixman at gmail dot com
  2011-11-22 15:46 ` [Bug c++/51265] [4.6/4.7 Regression] ICE " paolo.carlini at oracle dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: i.nixman at gmail dot com @ 2011-11-22  8:05 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51265
           Summary: internal compiler error: in finish_decltype_type, at
                    cp/semantics.c:5244
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: i.nixman@gmail.com


When I try to compile following code, I get error:
test1.cpp: In instantiation of 'void xx(T*, A ...) [with X = int
(Funny::*)(int) const; X ff = &Funny::print3; R = int; T = Funny; A = {int}]':
test1.cpp:35:74:   required from here
test1.cpp:23:9: internal compiler error: in finish_decltype_type, at
cp/semantics.c:5244

code:


#include <iostream>

struct Funny {
    void print(int i) {
        std::cout << "void (Funny::*)(int): " << i << std::endl;
    }
    int print2(int i) {
        std::cout << "int (Funny::*)(int): " << i << std::endl;
        return i;
    }
    int print3(int i)  const {
        std::cout << "int (Funny::*)(int) const: " << i << std::endl;
        return i;
    }
};
template<typename T, typename X, X ff>
void c(){ T abc; (abc.*ff)(123); }
template<typename X, X ff, typename R, typename T, typename... A >
void xx(T* _obj, A... args){
    for (int i : {2,4}) std::cout << i << std::endl; // #3 int i is OK
    {
/* 23 */ c<T, decltype(ff), ff>(); // #1 summary error trigger here
    }

    std::cout << "xx()" << std::endl;
    (_obj->*(ff))(args...);
    // #2 can not define any object here, even int
    // T abc; 
    //(abc.*ff)(args...);
}
int main()
{
    Funny abc;
/* 35 */ xx<int (Funny::*)(int)const, &Funny::print3, int, Funny, int>(&abc,
3);
    return 0;
}


configured with:
C:\test>g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/i686-pc-mingw32/4.7.0/lto-wrappe
r.exe
Target: i686-pc-mingw32
Configured with: ../../mingw-src/gcc-trunk/configure --host=i686-pc-mingw32
--bu
ild=i686-pc-mingw32 --target=i686-pc-mingw32 --prefix=/mingw-sjlj-x86
--with-arc
h=i686 --with-tune=generic --enable-languages=c,c++,lto,fortran,objc,obj-c++
--w
ith-host-libstdcxx=-lstdc++ --disable-shared --enable-static
--enable-cxx-flags=
'-fno-function-sections -fno-data-sections' --enable-libstdcxx-time=yes
--enable
-libgomp --enable-lto --enable-graphite --enable-cloog-backend=isl
--enable-chec
king=release --enable-fully-dynamic-string --enable-threads=posix
--disable-libs
tdcxx-pch --enable-libstdcxx-debug --enable-sjlj-exceptions --disable-debug
--di
sable-bootstrap --disable-multilib --disable-rpath --disable-win32-registry
--di
sable-nls --disable-werror --disable-symvers --with-gmp=/mingw-libs
--with-mpfr=
/mingw-libs --with-mpc=/mingw-libs --with-ppl=/mingw-libs
--with-cloog=/mingw-li
bs --with-libiconv-prefix=/mingw-libs --with-pkgversion='niXman build'
Thread model: posix


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

* [Bug c++/51265] [4.6/4.7 Regression] ICE in finish_decltype_type, at cp/semantics.c:5244
  2011-11-22  8:05 [Bug c++/51265] New: internal compiler error: in finish_decltype_type, at cp/semantics.c:5244 i.nixman at gmail dot com
@ 2011-11-22 15:46 ` paolo.carlini at oracle dot com
  2011-11-22 15:48 ` paolo.carlini at oracle dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-11-22 15:46 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-11-22
            Summary|internal compiler error: in |[4.6/4.7 Regression] ICE in
                   |finish_decltype_type, at    |finish_decltype_type, at
                   |cp/semantics.c:5244         |cp/semantics.c:5244
     Ever Confirmed|0                           |1

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-11-22 15:37:17 UTC ---
Can be reduced to this, and seems a Regression:

struct Funny
{
  int print3(int) const;
};

template<typename X, X ff>
void c();

template<typename X, X ff, typename R, typename... A>
void xx(A... args)
{
  c<decltype(ff), ff>();
}

int main()
{
  xx<int (Funny::*)(int) const, &Funny::print3, int, int>(3);
}


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

* [Bug c++/51265] [4.6/4.7 Regression] ICE in finish_decltype_type, at cp/semantics.c:5244
  2011-11-22  8:05 [Bug c++/51265] New: internal compiler error: in finish_decltype_type, at cp/semantics.c:5244 i.nixman at gmail dot com
  2011-11-22 15:46 ` [Bug c++/51265] [4.6/4.7 Regression] ICE " paolo.carlini at oracle dot com
@ 2011-11-22 15:48 ` paolo.carlini at oracle dot com
  2011-11-22 15:56 ` paolo.carlini at oracle dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-11-22 15:48 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |paolo.carlini at oracle dot
                   |gnu.org                     |com

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-11-22 15:46:04 UTC ---
On it. A tad simpler:

struct Funny
{
  int print(int);
};

template<typename X, X ff>
void c();

template<typename X, X ff>
void xx()
{
  c<decltype(ff), ff>();
}

int main()
{
  xx<int (Funny::*)(int), &Funny::print>();
}


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

* [Bug c++/51265] [4.6/4.7 Regression] ICE in finish_decltype_type, at cp/semantics.c:5244
  2011-11-22  8:05 [Bug c++/51265] New: internal compiler error: in finish_decltype_type, at cp/semantics.c:5244 i.nixman at gmail dot com
  2011-11-22 15:46 ` [Bug c++/51265] [4.6/4.7 Regression] ICE " paolo.carlini at oracle dot com
  2011-11-22 15:48 ` paolo.carlini at oracle dot com
@ 2011-11-22 15:56 ` paolo.carlini at oracle dot com
  2011-11-22 16:09 ` paolo.carlini at oracle dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-11-22 15:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-11-22 15:48:12 UTC ---
Even:

struct Funny;

template<typename X>
void c();

template<typename X>
void xx()
{
  c<decltype(ff)>();
}

int main()
{
  xx<int(Funny::*)(int)>();
}


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

* [Bug c++/51265] [4.6/4.7 Regression] ICE in finish_decltype_type, at cp/semantics.c:5244
  2011-11-22  8:05 [Bug c++/51265] New: internal compiler error: in finish_decltype_type, at cp/semantics.c:5244 i.nixman at gmail dot com
                   ` (2 preceding siblings ...)
  2011-11-22 15:56 ` paolo.carlini at oracle dot com
@ 2011-11-22 16:09 ` paolo.carlini at oracle dot com
  2011-11-22 20:57 ` paolo at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-11-22 16:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-11-22 15:50:04 UTC ---
oops, scratch the latter ;)


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

* [Bug c++/51265] [4.6/4.7 Regression] ICE in finish_decltype_type, at cp/semantics.c:5244
  2011-11-22  8:05 [Bug c++/51265] New: internal compiler error: in finish_decltype_type, at cp/semantics.c:5244 i.nixman at gmail dot com
                   ` (3 preceding siblings ...)
  2011-11-22 16:09 ` paolo.carlini at oracle dot com
@ 2011-11-22 20:57 ` paolo at gcc dot gnu.org
  2011-11-22 21:51 ` paolo at gcc dot gnu.org
  2011-11-22 21:56 ` paolo.carlini at oracle dot com
  6 siblings, 0 replies; 8+ messages in thread
From: paolo at gcc dot gnu.org @ 2011-11-22 20:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> 2011-11-22 20:48:38 UTC ---
Author: paolo
Date: Tue Nov 22 20:48:33 2011
New Revision: 181638

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181638
Log:
/cp
2011-11-22  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/51265
    * semantics.c (finish_decltype_type): Handle PTRMEM_CST.

/testsuite
2011-11-22  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/51265
    * g++.dg/cpp0x/decltype36.C: New.

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


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

* [Bug c++/51265] [4.6/4.7 Regression] ICE in finish_decltype_type, at cp/semantics.c:5244
  2011-11-22  8:05 [Bug c++/51265] New: internal compiler error: in finish_decltype_type, at cp/semantics.c:5244 i.nixman at gmail dot com
                   ` (4 preceding siblings ...)
  2011-11-22 20:57 ` paolo at gcc dot gnu.org
@ 2011-11-22 21:51 ` paolo at gcc dot gnu.org
  2011-11-22 21:56 ` paolo.carlini at oracle dot com
  6 siblings, 0 replies; 8+ messages in thread
From: paolo at gcc dot gnu.org @ 2011-11-22 21:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> 2011-11-22 21:37:27 UTC ---
Author: paolo
Date: Tue Nov 22 21:37:24 2011
New Revision: 181641

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181641
Log:
/cp
2011-11-22  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/51265
    * semantics.c (finish_decltype_type): Handle PTRMEM_CST.

/testsuite
2011-11-22  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/51265
    * g++.dg/cpp0x/decltype36.C: New.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/decltype36.C
Modified:
    branches/gcc-4_6-branch/gcc/cp/ChangeLog
    branches/gcc-4_6-branch/gcc/cp/semantics.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


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

* [Bug c++/51265] [4.6/4.7 Regression] ICE in finish_decltype_type, at cp/semantics.c:5244
  2011-11-22  8:05 [Bug c++/51265] New: internal compiler error: in finish_decltype_type, at cp/semantics.c:5244 i.nixman at gmail dot com
                   ` (5 preceding siblings ...)
  2011-11-22 21:51 ` paolo at gcc dot gnu.org
@ 2011-11-22 21:56 ` paolo.carlini at oracle dot com
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-11-22 21:56 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #7 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-11-22 21:38:37 UTC ---
Fixed for 4.6.3 and mainline.


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

end of thread, other threads:[~2011-11-22 21:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-22  8:05 [Bug c++/51265] New: internal compiler error: in finish_decltype_type, at cp/semantics.c:5244 i.nixman at gmail dot com
2011-11-22 15:46 ` [Bug c++/51265] [4.6/4.7 Regression] ICE " paolo.carlini at oracle dot com
2011-11-22 15:48 ` paolo.carlini at oracle dot com
2011-11-22 15:56 ` paolo.carlini at oracle dot com
2011-11-22 16:09 ` paolo.carlini at oracle dot com
2011-11-22 20:57 ` paolo at gcc dot gnu.org
2011-11-22 21:51 ` paolo at gcc dot gnu.org
2011-11-22 21:56 ` paolo.carlini at oracle 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).