https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68884

            Bug ID: 68884
           Summary: template of value template crashes the compiler
           Product: gcc
           Version: 5.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: meinaccountnr2 at web dot de
  Target Milestone: ---

Created attachment 37020
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37020&action=edit
source

compiling the following code crashes the compiler:

tst.cpp
/////////////////////////////////////////////////////////////////////////////
#include<type_traits>

template<int...> struct VsA{};

template<class ValueType>
struct ValueTemplate
{
    template<template<ValueType...TypesA> class TemplateA, class T           >
struct IsInstanceOf                                  : std::false_type{};
    template<template<ValueType...TypesA> class TemplateA, ValueType...TypesA>
struct IsInstanceOf<TemplateA, TemplateA<TypesA...>> : std:: true_type{};
};

static const bool foo = ValueTemplate<int>::IsInstanceOf<VsA,VsA<0>>::value;

int main(){return 0;};
/////////////////////////////////////////////////////////////////////////////

compiler: gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4 
(crashes on http://coliru.stacked-crooked.com/ with gcc 5.2, too.)

command: gcc --std=c++11 tst.cpp

Reply via email to