This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/4429: certain member variables that shadow template parameters cause ice.
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/4429: certain member variables that shadow template parameters cause ice.
- From: xternal at centibyte dot org
- Date: 1 Oct 2001 00:13:47 -0000
- Reply-To: xternal at centibyte dot org
>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<char type> class TestTemplate {
public:
const static MyClass type[] = {MyClass(), MyClass()};
};
>Fix:
Change one of the variable names.
>Release-Note:
>Audit-Trail:
>Unformatted: