public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57817] New: g++ crashes on handling variadic template sizeof inside lambda funcion
@ 2013-07-04  1:42 lb-guilherme at live dot com
  2013-07-04  8:32 ` [Bug c++/57817] " paolo.carlini at oracle dot com
  0 siblings, 1 reply; 2+ messages in thread
From: lb-guilherme at live dot com @ 2013-07-04  1:42 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 57817
           Summary: g++ crashes on handling variadic template sizeof
                    inside lambda funcion
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lb-guilherme at live dot com

The following code produces a crash on both GCC 4.7.3 and 4.8.1:

template <typename... T>
void f(T... a)
{
  [&]{
    int s = sizeof...(a);
  }();
}

int main()
{
  f();
}

This is the crash report from GCC 4.8.1:

test.cpp: In instantiation of 'f(T ...) [with T = {}]::__lambda0':
test.cpp:5:5:   required from 'struct f(T ...) [with T = {}]::__lambda0'
test.cpp:7:5:   required from 'void f(T ...) [with T = {}]'
test.cpp:12:5:   required from here
test.cpp:6:19: internal compiler error: Segmentation fault
     int s = sizeof...(a);
                   ^
0x850d2f0 crash_signal
    /opt/mxe/tmp-gcc/gcc-4.8.1/gcc/toplev.c:332
0x814f26b tsubst_copy
    /opt/mxe/tmp-gcc/gcc-4.8.1/gcc/cp/pt.c:12114
0x8146ebf tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
    /opt/mxe/tmp-gcc/gcc-4.8.1/gcc/cp/pt.c:14445
0x814ac4a tsubst_expr
    /opt/mxe/tmp-gcc/gcc-4.8.1/gcc/cp/pt.c:13385
0x8151246 tsubst_pack_expansion
    /opt/mxe/tmp-gcc/gcc-4.8.1/gcc/cp/pt.c:9475
0x814f0ed tsubst_copy
    /opt/mxe/tmp-gcc/gcc-4.8.1/gcc/cp/pt.c:12263
0x814843c tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
    /opt/mxe/tmp-gcc/gcc-4.8.1/gcc/cp/pt.c:14571
0x814ac4a tsubst_expr
    /opt/mxe/tmp-gcc/gcc-4.8.1/gcc/cp/pt.c:13385
0x814c4ed tsubst_expr
    /opt/mxe/tmp-gcc/gcc-4.8.1/gcc/cp/pt.c:12943
0x814b98f tsubst_expr
    /opt/mxe/tmp-gcc/gcc-4.8.1/gcc/cp/pt.c:13040
0x814b98f tsubst_expr
    /opt/mxe/tmp-gcc/gcc-4.8.1/gcc/cp/pt.c:13040
0x814a8ce instantiate_decl(tree_node*, int, bool)
    /opt/mxe/tmp-gcc/gcc-4.8.1/gcc/cp/pt.c:18920
0x815e7ed instantiate_class_template_1
    /opt/mxe/tmp-gcc/gcc-4.8.1/gcc/cp/pt.c:9015
0x815e7ed instantiate_class_template(tree_node*)
    /opt/mxe/tmp-gcc/gcc-4.8.1/gcc/cp/pt.c:9083
0x81ad52b complete_type(tree_node*)
    /opt/mxe/tmp-gcc/gcc-4.8.1/gcc/cp/typeck.c:131
0x8147703 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
    /opt/mxe/tmp-gcc/gcc-4.8.1/gcc/cp/pt.c:14542
0x8147cfb tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
    /opt/mxe/tmp-gcc/gcc-4.8.1/gcc/cp/pt.c:13951
0x814ac4a tsubst_expr
    /opt/mxe/tmp-gcc/gcc-4.8.1/gcc/cp/pt.c:13385
0x814b31a tsubst_expr
    /opt/mxe/tmp-gcc/gcc-4.8.1/gcc/cp/pt.c:12864
0x814b4dc tsubst_expr
    /opt/mxe/tmp-gcc/gcc-4.8.1/gcc/cp/pt.c:12850
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


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

* [Bug c++/57817] g++ crashes on handling variadic template sizeof inside lambda funcion
  2013-07-04  1:42 [Bug c++/57817] New: g++ crashes on handling variadic template sizeof inside lambda funcion lb-guilherme at live dot com
@ 2013-07-04  8:32 ` paolo.carlini at oracle dot com
  0 siblings, 0 replies; 2+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-07-04  8:32 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Dup.

*** This bug has been marked as a duplicate of bug 55914 ***


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

end of thread, other threads:[~2013-07-04  8:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-04  1:42 [Bug c++/57817] New: g++ crashes on handling variadic template sizeof inside lambda funcion lb-guilherme at live dot com
2013-07-04  8:32 ` [Bug c++/57817] " 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).