This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/24448] New: Internal error: Segmentation fault (program cc1plus)


The following crashes g++:

enum Channel { A, enumMin = A, B, enumMax = B };

template < typename T >
struct enum_traits {

  static T const first = T::enumMin;

};

template < typename Enum >
struct cb_handler {

  typedef Enum channel_type;
  typedef void(*callback_function)(void);

  static channel_type const min_channel = enum_traits<channel_type>::first;

  template < channel_type channel >
  static
  void forward ( void ) {}

 public:

  static
  callback_function bad ( void ) {
    return( forward<min_channel> );
  }

}; // cb_handler;

typedef cb_handler<Channel> handler;

int main ( void ) {
  handler::bad();
}



My settings:

> /added/pkg/gcc-4.0.1/usr/bin/g++ -v       
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.0.1/configure --prefix=/added/pkg/gcc-4.0.1/usr
Thread model: posix
gcc version 4.0.1


-- 
           Summary: Internal error: Segmentation fault (program cc1plus)
           Product: gcc
           Version: 4.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jkherciueh at gmx dot net


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]