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

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