public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55639] New: Partial nested template specialization leads to segmentation fault of g++
@ 2012-12-10 13:24 mk at nopw dot de
  2012-12-10 13:40 ` [Bug c++/55639] " paolo.carlini at oracle dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: mk at nopw dot de @ 2012-12-10 13:24 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55639
           Summary: Partial nested template specialization leads to
                    segmentation fault of g++
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mk@nopw.de


Created attachment 28912
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28912
test case that cause g++ to exit with segmenation fault

When I compile the attached C++ file g++ finishes with a segmentation fault.

The problem might lie in the partial nested template specialization. If I
either remove the surrounding class (and defined the struct in the global
namespace) or if I remove the template specialization the error goes away.

Compiler version: g++-4.7 (Ubuntu/Linaro 4.7.2-11precise2) 4.7.2
Call: g++-4.7 -Wall -std=c++11 -o test template_specialization.cc


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

* [Bug c++/55639] Partial nested template specialization leads to segmentation fault of g++
  2012-12-10 13:24 [Bug c++/55639] New: Partial nested template specialization leads to segmentation fault of g++ mk at nopw dot de
@ 2012-12-10 13:40 ` paolo.carlini at oracle dot com
  2012-12-10 14:18 ` veksler at il dot ibm.com
  2012-12-10 14:23 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-12-10 13:40 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-12-10 13:40:18 UTC ---
The issue is the 'template' keyword in:

SomeClass<number>::template Fun<E, 0>

without it, the code is accepted (ICC also accepts it). I'm pretty sure this is
a Dup of another issue we already have in Bugzilla.


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

* [Bug c++/55639] Partial nested template specialization leads to segmentation fault of g++
  2012-12-10 13:24 [Bug c++/55639] New: Partial nested template specialization leads to segmentation fault of g++ mk at nopw dot de
  2012-12-10 13:40 ` [Bug c++/55639] " paolo.carlini at oracle dot com
@ 2012-12-10 14:18 ` veksler at il dot ibm.com
  2012-12-10 14:23 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: veksler at il dot ibm.com @ 2012-12-10 14:18 UTC (permalink / raw)
  To: gcc-bugs


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

Michael Veksler <veksler at il dot ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |veksler at il dot ibm.com

--- Comment #2 from Michael Veksler <veksler at il dot ibm.com> 2012-12-10 14:18:07 UTC ---
I have a possibly similar test case (can someone confirm if my case is a DUP?).


--- t.cpp --
template <typename T>
struct A {
   template <int a>
   struct B;
};

template <typename T>
struct A<T>::template B<0> {
   int foo();
};

---- end --

$ /opt/gcc4.7.2/bin/g++ t.cpp
t.cpp:8:23: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

$/opt/gcc4.7.2/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/opt/gcc4.7.2/bin/g++
COLLECT_LTO_WRAPPER=/opt/gcc4.7.2/libexec/gcc/x86_64-unknown-linux-gnu/4.7.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.7.2/configure --prefix=/opt/gcc4.7.2
Thread model: posix
gcc version 4.7.2 (GCC)


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

* [Bug c++/55639] Partial nested template specialization leads to segmentation fault of g++
  2012-12-10 13:24 [Bug c++/55639] New: Partial nested template specialization leads to segmentation fault of g++ mk at nopw dot de
  2012-12-10 13:40 ` [Bug c++/55639] " paolo.carlini at oracle dot com
  2012-12-10 14:18 ` veksler at il dot ibm.com
@ 2012-12-10 14:23 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-12-10 14:23 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-12-10 14:23:16 UTC ---
It is, it is.


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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-10 13:24 [Bug c++/55639] New: Partial nested template specialization leads to segmentation fault of g++ mk at nopw dot de
2012-12-10 13:40 ` [Bug c++/55639] " paolo.carlini at oracle dot com
2012-12-10 14:18 ` veksler at il dot ibm.com
2012-12-10 14:23 ` 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).