[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#284777: g++-3.4: internal compiler error: in uses_template_parms at cp/pt.c:4860



Package: g++-3.4
Version: 3.4.2-2
Severity: important

Hi, 

the following (error prone) C++ code triggers an internal compiler error in
uses_template_parms, at cp/pt.c:4860


template<typename T>
struct Dummy
{
  void evil()
  {
    this->template tester<true>();
  }
	    
  template<bool B>
  void tester()
  {
    // evil should actually be a bool  
    bar<evil>()();
  }
  template<bool B>
  struct bar
  {
    void operator()()
    { }
  };
};

int main()
{}

If class Dummy is not a template class the code triggers no internal compiler error
but the following error message:

testcase1.cc: In member function `void Dummy::tester()':
testcase1.cc:12: error: `void Dummy::evil()' cannot appear in a constant-expression
testcase1.cc:12: error: template argument 1 is invalid

Cheers,

Markus Blatt

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.4.27thinkpad
Locale: LANG=de_DE@euro, LC_CTYPE=de_DE@euro (charmap=ISO-8859-15)

Versions of packages g++-3.4 depends on:
ii  gcc-3.4                     3.4.2-2      The GNU C compiler
ii  gcc-3.4-base                3.4.2-2      The GNU Compiler Collection (base 
ii  libc6                       2.3.2.ds1-18 GNU C Library: Shared libraries an
ii  libstdc++6-dev              3.4.2-2      The GNU Standard C++ Library v3 (d

-- no debconf information



Reply to: