public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/28225]  New: [4.0/4.1/4.2 regression] segfault in type_dependent_expression_p
@ 2006-07-02 23:52 tbm at cyrius dot com
  2006-07-02 23:53 ` [Bug c++/28225] " tbm at cyrius dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: tbm at cyrius dot com @ 2006-07-02 23:52 UTC (permalink / raw)
  To: gcc-bugs

[ Forwarded from http://bugs.debian.org/376148 ]

The following bug has been reported by Alexei Sheplyakov who submitted a
testcase which shows a segfault with gcc 4.0, 4.1 and 4.2.  gcc 3.4 produces an
error:

(sid)1311:tbm@reyes: ~] g++-4.0 -c test.cc
test.cc: In member function 'void foo<T1>::operator()(T1&, T3&)':
test.cc:14: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-4.0/README.Bugs>.
zsh: exit 1     g++-4.0 -c test.cc
(sid)1312:tbm@reyes: ~] g++-4.1 -c test.cc
test.cc: In member function 'void foo<T1>::operator()(T1&, T3&)':
test.cc:14: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-4.1/README.Bugs>.
Preprocessed source stored into /tmp/ccj3KtQL.out file, please attach this to
your bugreport.
zsh: exit 1     g++-4.1 -c test.cc
(sid)1313:tbm@reyes: ~] g++-3.4 -c test.cc
test.cc: In member function 'void foo<T1>::operator()(T1&, T3&)':
test.cc:14: error: non-constant 'foo<T1>::N_BC' cannot be used as template
argument
test.cc:14: error: template argument 3 is invalid
test.cc:14: error: invalid type in declaration before '(' token
zsh: exit 1     g++-3.4 -c test.cc
(sid)1314:tbm@reyes: ~]
(sid)1314:tbm@reyes: ~] cat test.cc
template<typename T> struct size_traits;
template<typename T, unsigned N> struct same_size_p;

template<typename T1> struct foo {
        static const unsigned N_BC = size_traits<T1>::Size;

        template<typename T2, unsigned N,
                bool pred = same_size_p<T2, N_BC>::value > struct bar;
        template<typename T2, unsigned N> struct bar<T2, N, true> {
                static void apply(const T1& x, T2& y) { }
        };

        template<typename T3> void operator()(T1& a, T3& b) {
                bar<T3, N_BC>::apply(a, b); // will get an ICE here
                // Here is a work-around:
                //bar<T3, N_BC, same_size_p<T3, N_BC>::value>::apply(a, b);
        }
};


-- 
           Summary: [4.0/4.1/4.2 regression] segfault in
                    type_dependent_expression_p
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tbm at cyrius dot com


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


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

end of thread, other threads:[~2006-07-20  9:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-02 23:52 [Bug c++/28225] New: [4.0/4.1/4.2 regression] segfault in type_dependent_expression_p tbm at cyrius dot com
2006-07-02 23:53 ` [Bug c++/28225] " tbm at cyrius dot com
2006-07-03 21:02 ` pinskia at gcc dot gnu dot org
2006-07-04 14:06 ` rguenth at gcc dot gnu dot org
2006-07-05  5:45 ` varg at theor dot jinr dot ru
2006-07-17  3:00 ` mmitchel at gcc dot gnu dot org
2006-07-19 17:38 ` mmitchel at gcc dot gnu dot org
2006-07-20  9:10 ` tbm at cyrius dot com
2006-07-20  9:16 ` [Bug c++/28225] [4.0 " pinskia at gcc dot gnu dot org
2006-07-20  9:18 ` pinskia at gcc dot gnu dot 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).