[Bug c++/18905] [4.0 Regression] Strange error: subscripted value is neither array nor pointer

cvs-commit at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Dec 16 11:04:00 GMT 2004


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-12-16 11:04 -------
Subject: Bug 18905

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	nathan@gcc.gnu.org	2004-12-16 11:04:09

Modified files:
	gcc/cp         : call.c class.c cp-tree.h cvt.c decl.c decl2.c 
	                 init.c pt.c typeck.c ChangeLog 
	gcc/testsuite/g++.dg/opt: static3.C 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/template: init4.C 

Log message:
	cp:
	PR c++/18905
	* cp-tree.h (integral_constant_value): Declare.
	* call.c (null_ptr_cst_p): Use integral_constant_value, not
	decl_constant_value.
	(convert_like_real): Likewise.
	* class.c (check_bitfield_decl): Likewise.
	* cvt.c (ocp_convert): Likewise.
	(convert): Remove unnecessary decl_constant_value call.
	* decl.c (compute_array_index_type): Use integral_constant_value,
	not decl_constant_value.
	(build_enumerator): Likewise.
	* decl2.c (grokfield): Likewise.
	* init.c (decl_constant_value): Simplify.
	(integral_constant_value): New.
	* pt.c (fold_decl_constant_value): Use integral_constant_value,
	remove subsequent check.
	(tsubst): Use integral_constant_value, not decl_constant_value.
	(tsubst_copy, unify): Likewise.
	* typeck.c (decay_conversion): Likewise.
	(build_compound_expr): Remove unnecessary decl_constant_value
	calls.
	(build_static_cast_1, build_reinterpret_cast_1):
	(convert_for_assignment): Remove comment about not calling
	decl_constant_value.
	testsuite:
	PR c++/18905
	* g++.dg/template/init4.C: New.
	* g++.dg/opt/static3.C: Enable optimizer.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&r1=1.522&r2=1.523
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/class.c.diff?cvsroot=gcc&r1=1.694&r2=1.695
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&r1=1.1080&r2=1.1081
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cvt.c.diff?cvsroot=gcc&r1=1.173&r2=1.174
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1341&r2=1.1342
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl2.c.diff?cvsroot=gcc&r1=1.760&r2=1.761
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/init.c.diff?cvsroot=gcc&r1=1.405&r2=1.406
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.958&r2=1.959
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&r1=1.604&r2=1.605
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4538&r2=1.4539
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/static3.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4768&r2=1.4769
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/init4.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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



More information about the Gcc-bugs mailing list