public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55564] New: internal error using decltype of a template type parameter for late-specified function result type
@ 2012-12-02 19:30 public at alisdairm dot net
  2012-12-02 23:52 ` [Bug c++/55564] 4.8 Regression] " paolo.carlini at oracle dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: public at alisdairm dot net @ 2012-12-02 19:30 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55564
           Summary: internal error using decltype of a template type
                    parameter for late-specified function result type
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: public@alisdairm.net


The following program gives an internal compiler error, when built with the
command line:  g++ -std=c++11 main.cpp

//---------------------------------------------------

template <typename T, decltype(sizeof(T)) N>
auto array_size(T(&)[N]) -> decltype(N) { return N; }

int main() {
   int simple[4] = {};
   int result =  array_size(simple);

   return result;
}

//---------------------------------------------------


The error I get from my build of gcc is:

main.cpp: In function 'int main()':
main.cpp:1:38: internal compiler error: in dependent_type_p, at cp/pt.c:19249
 template <typename T, decltype(sizeof(T)) N>
                                      ^

main.cpp:1:38: internal compiler error: Abort trap: 6
g++-mp-4.8: internal compiler error: Abort trap: 6 (program cc1plus)
Abort trap: 6


Build is a recent version obtained from MacPorts, running on the latest Apple
Mountain Lion OS with up to date patches.

g++ -v:

Using built-in specs.
COLLECT_GCC=g++-mp-4.8
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin12/4.8.0/lto-wrapper
Target: x86_64-apple-darwin12
Configured with: ../gcc-4.8-20121125/configure --prefix=/opt/local
--build=x86_64-apple-darwin12
--enable-languages=c,c++,objc,obj-c++,fortran,java
--libdir=/opt/local/lib/gcc48 --includedir=/opt/local/include/gcc48
--infodir=/opt/local/share/info --mandir=/opt/local/share/man
--datarootdir=/opt/local/share/gcc-4.8 --with-local-prefix=/opt/local
--with-system-zlib --disable-nls --program-suffix=-mp-4.8
--with-gxx-include-dir=/opt/local/include/gcc48/c++/ --with-gmp=/opt/local
--with-mpfr=/opt/local --with-mpc=/opt/local --with-ppl=/opt/local
--with-cloog=/opt/local --enable-cloog-backend=isl
--disable-cloog-version-check --enable-stage1-checking --disable-multilib
--enable-lto --enable-libstdcxx-time --with-as=/opt/local/bin/as
--with-ld=/opt/local/bin/ld --with-ar=/opt/local/bin/ar
--with-bugurl=https://trac.macports.org/newticket --with-pkgversion='MacPorts
gcc48 4.8-20121125_0'
Thread model: posix
gcc version 4.8.0 20121125 (experimental) (MacPorts gcc48 4.8-20121125_0)


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

* [Bug c++/55564] 4.8 Regression] internal error using decltype of a template type parameter for late-specified function result type
  2012-12-02 19:30 [Bug c++/55564] New: internal error using decltype of a template type parameter for late-specified function result type public at alisdairm dot net
@ 2012-12-02 23:52 ` paolo.carlini at oracle dot com
  2012-12-03 17:44 ` paolo.carlini at oracle dot com
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-12-02 23:52 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-12-02
            Summary|internal error using        |4.8 Regression] internal
                   |decltype of a template type |error using decltype of a
                   |parameter for               |template type parameter for
                   |late-specified function     |late-specified function
                   |result type                 |result type
     Ever Confirmed|0                           |1

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-12-02 23:52:30 UTC ---
Seems a regression.


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

* [Bug c++/55564] 4.8 Regression] internal error using decltype of a template type parameter for late-specified function result type
  2012-12-02 19:30 [Bug c++/55564] New: internal error using decltype of a template type parameter for late-specified function result type public at alisdairm dot net
  2012-12-02 23:52 ` [Bug c++/55564] 4.8 Regression] " paolo.carlini at oracle dot com
@ 2012-12-03 17:44 ` paolo.carlini at oracle dot com
  2012-12-03 17:49 ` hjl.tools at gmail dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-12-03 17:44 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl.tools at gmail dot com

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-12-03 17:44:37 UTC ---
HJ, can you find when we regressed on this?


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

* [Bug c++/55564] 4.8 Regression] internal error using decltype of a template type parameter for late-specified function result type
  2012-12-02 19:30 [Bug c++/55564] New: internal error using decltype of a template type parameter for late-specified function result type public at alisdairm dot net
  2012-12-02 23:52 ` [Bug c++/55564] 4.8 Regression] " paolo.carlini at oracle dot com
  2012-12-03 17:44 ` paolo.carlini at oracle dot com
@ 2012-12-03 17:49 ` hjl.tools at gmail dot com
  2012-12-03 17:58 ` paolo.carlini at oracle dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: hjl.tools at gmail dot com @ 2012-12-03 17:49 UTC (permalink / raw)
  To: gcc-bugs


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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mjambor at suse dot cz
   Target Milestone|---                         |4.8.0

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> 2012-12-03 17:49:32 UTC ---
It is caused by revision 190830:

http://gcc.gnu.org/ml/gcc-cvs/2012-08/msg00809.html


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

* [Bug c++/55564] 4.8 Regression] internal error using decltype of a template type parameter for late-specified function result type
  2012-12-02 19:30 [Bug c++/55564] New: internal error using decltype of a template type parameter for late-specified function result type public at alisdairm dot net
                   ` (2 preceding siblings ...)
  2012-12-03 17:49 ` hjl.tools at gmail dot com
@ 2012-12-03 17:58 ` paolo.carlini at oracle dot com
  2012-12-03 18:07 ` hjl.tools at gmail dot com
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-12-03 17:58 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|mjambor at suse dot cz      |

--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-12-03 17:58:13 UTC ---
Are you kidding? This is a front-end issue and happens also at -O0.


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

* [Bug c++/55564] 4.8 Regression] internal error using decltype of a template type parameter for late-specified function result type
  2012-12-02 19:30 [Bug c++/55564] New: internal error using decltype of a template type parameter for late-specified function result type public at alisdairm dot net
                   ` (3 preceding siblings ...)
  2012-12-03 17:58 ` paolo.carlini at oracle dot com
@ 2012-12-03 18:07 ` hjl.tools at gmail dot com
  2012-12-03 18:22 ` paolo.carlini at oracle dot com
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: hjl.tools at gmail dot com @ 2012-12-03 18:07 UTC (permalink / raw)
  To: gcc-bugs


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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at redhat dot com

--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> 2012-12-03 18:07:06 UTC ---
(In reply to comment #3)
> It is caused by revision 190830:
> 
> http://gcc.gnu.org/ml/gcc-cvs/2012-08/msg00809.html

Oops. Right revision, wrong link:

http://gcc.gnu.org/ml/gcc-cvs/2012-08/msg00808.html


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

* [Bug c++/55564] 4.8 Regression] internal error using decltype of a template type parameter for late-specified function result type
  2012-12-02 19:30 [Bug c++/55564] New: internal error using decltype of a template type parameter for late-specified function result type public at alisdairm dot net
                   ` (4 preceding siblings ...)
  2012-12-03 18:07 ` hjl.tools at gmail dot com
@ 2012-12-03 18:22 ` paolo.carlini at oracle dot com
  2012-12-05 16:34 ` [Bug c++/55564] [4.8 " jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-12-03 18:22 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|hjl.tools at gmail dot com  |

--- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-12-03 18:21:56 UTC ---
Thanks.


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

* [Bug c++/55564] [4.8 Regression] internal error using decltype of a template type parameter for late-specified function result type
  2012-12-02 19:30 [Bug c++/55564] New: internal error using decltype of a template type parameter for late-specified function result type public at alisdairm dot net
                   ` (5 preceding siblings ...)
  2012-12-03 18:22 ` paolo.carlini at oracle dot com
@ 2012-12-05 16:34 ` jason at gcc dot gnu.org
  2012-12-06 14:37 ` jason at gcc dot gnu.org
  2012-12-06 14:42 ` jason at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2012-12-05 16:34 UTC (permalink / raw)
  To: gcc-bugs


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

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

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


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

* [Bug c++/55564] [4.8 Regression] internal error using decltype of a template type parameter for late-specified function result type
  2012-12-02 19:30 [Bug c++/55564] New: internal error using decltype of a template type parameter for late-specified function result type public at alisdairm dot net
                   ` (6 preceding siblings ...)
  2012-12-05 16:34 ` [Bug c++/55564] [4.8 " jason at gcc dot gnu.org
@ 2012-12-06 14:37 ` jason at gcc dot gnu.org
  2012-12-06 14:42 ` jason at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2012-12-06 14:37 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> 2012-12-06 14:36:59 UTC ---
Author: jason
Date: Thu Dec  6 14:36:55 2012
New Revision: 194248

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194248
Log:
    PR c++/55564
    * pt.c (unify) [ARRAY_TYPE]: Unify the element type before the bounds.

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


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

* [Bug c++/55564] [4.8 Regression] internal error using decltype of a template type parameter for late-specified function result type
  2012-12-02 19:30 [Bug c++/55564] New: internal error using decltype of a template type parameter for late-specified function result type public at alisdairm dot net
                   ` (7 preceding siblings ...)
  2012-12-06 14:37 ` jason at gcc dot gnu.org
@ 2012-12-06 14:42 ` jason at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2012-12-06 14:42 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> 2012-12-06 14:42:08 UTC ---
Fixed.


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

end of thread, other threads:[~2012-12-06 14:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-02 19:30 [Bug c++/55564] New: internal error using decltype of a template type parameter for late-specified function result type public at alisdairm dot net
2012-12-02 23:52 ` [Bug c++/55564] 4.8 Regression] " paolo.carlini at oracle dot com
2012-12-03 17:44 ` paolo.carlini at oracle dot com
2012-12-03 17:49 ` hjl.tools at gmail dot com
2012-12-03 17:58 ` paolo.carlini at oracle dot com
2012-12-03 18:07 ` hjl.tools at gmail dot com
2012-12-03 18:22 ` paolo.carlini at oracle dot com
2012-12-05 16:34 ` [Bug c++/55564] [4.8 " jason at gcc dot gnu.org
2012-12-06 14:37 ` jason at gcc dot gnu.org
2012-12-06 14:42 ` 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).