This is the mail archive of the gcc-prs@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]

c++/4429: certain member variables that shadow template parameters cause ice.



>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:


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