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++/11432] New: ICE with int templates and static members, regression from 2.95 and 3.3


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: ICE with int templates and static members, regression
                    from 2.95 and 3.3
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: benko at sztaki dot hu
                CC: gcc-bugs at gcc dot gnu dot org

This example is a brainless reduction of a code I can't understand,
but it compiled so long.  I know no workaround.


arta:~/c/proba$ cat templ_shift1.cc
template <int A>
struct a
{
  static int const value = A - 1;
};

template <int B>
struct b
{
  static int foo()
  {
    return a<L>::value;
  }

  static int const L = a<B + 1>::value;
};


int
main()
{
  return b<1>::foo();
}
arta:~/c/proba$ g++-cvs -v
Reading specs from /gml/shared/gcc-cvs/lib/gcc-lib/i686-pc-linux-gnu/3.4/specs
Configured with: ../gcc/configure --prefix=/gml/shared/gcc-cvs
--enable-languages=c++
Thread model: posix
gcc version 3.4 20030703 (experimental)
arta:~/c/proba$ g++-cvs templ_shift1.cc
templ_shift1.cc: In static member function `static int b<B>::foo() [with int B 
   = 1]':
templ_shift1.cc:4:   instantiated from `const int a<1>::value'
templ_shift1.cc:12:   instantiated from `static int b<B>::foo() [with int B =
1]'
templ_shift1.cc:22:   instantiated from here
templ_shift1.cc:4: internal compiler error: in instantiate_decl, at cp/pt.c:
   10812
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
zsh: exit 1     g++-cvs templ_shift1.cc
arta:~/c/proba$


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