From mboxrd@z Thu Jan 1 00:00:00 1970 From: xternal@centibyte.org To: gcc-gnats@gcc.gnu.org Subject: c++/4429: certain member variables that shadow template parameters cause ice. Date: Sun, 30 Sep 2001 17:26:00 -0000 Message-id: <20011001001347.28405.qmail@sourceware.cygnus.com> X-SW-Source: 2001-09/msg00593.html List-Id: >Number: 4429 >Category: c++ >Synopsis: certain member variables that shadow template parameters cause ice. >Confidential: no >Severity: non-critical >Priority: low >Responsible: unassigned >State: open >Class: ice-on-illegal-code >Submitter-Id: net >Arrival-Date: Sun Sep 30 17:26:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: xternal@centibyte.org >Release: gcc version 3.0.2 20010922 (Debian prerelease) >Organization: >Environment: )gured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,objc --prefix=/usr --infodir=/share/info --mandir=/share/man --enable-shared --with-gnu-as --with-gnu-ld --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-checking --enable-threads=posix --enable-java-gc=boehm --with-cpp-install-dir=bin --enable-objc-gc i386-linux >Description: Array member variables that are declared const and static and shadow a template parameter cause an ice. The template parameter must be a built in type, and the array member an array of classes. If the variable is not declared const or static, or it is a builtin type, or if the template parameter is not a builtin type, a normal syntax error message will result instead. I got the same results with g++ 3.0.2 and g++ 2.95.4. >How-To-Repeat: Run the followingn command on the following file: g++ bugtest.cc //bugtest.ccclass MyClass { }; template class TestTemplate { public: const static MyClass type[] = {MyClass(), MyClass()}; }; >Fix: Change one of the variable names. >Release-Note: >Audit-Trail: >Unformatted: