4.1 branch gives an error, message, 4.2 and up segfault.

  Matthias

$ g++-4.1 -save-temps bug.cc
bug.cc:17: error: could not convert template argument 'BUG::name' to 'bool'

$ g++ -save-temps bug.cc
bug.cc:17: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.

class BUG
{
public:
 bool name() { return true; }
};

template <bool T>
struct BUG1_5
{

};

template <bool name>
class BUG2 : BUG
{
public:
 typedef BUG1_5<name> ptr;
};

int main()
{
 BUG2<false> b;
 return 0;
}


-- 
           Summary: [4.2/4.3/4.4 regression] ICE cc1plus (Segmentation
                    fault)
           Product: gcc
           Version: 4.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: debian-gcc at lists dot debian dot org


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

Reply via email to