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

Re: Vector subscripts in C++


Also added Richard in Cc: as the author of the C front-end code I am sharing with the C++ front-end.

Looks like I forgot to say it here (was in bugzilla), but the patch was tested in a c,c++ bootstrap + make -k check on linux x86_64.

Reattaching the patch (now using the recommended diff options).

On Tue, 17 Apr 2012, Marc Glisse wrote:


this patch adds vector subscripting to C++ by reusing the C code. build_array_ref and cp_build_array_ref could probably share more, but I don't understand them enough to do it.

(note that I can't commit, so if you like the patch...)

2012-04-17  Marc Glisse  <>

	PR c++/51033
	* typeck.c (cp_build_array_ref): Handle VECTOR_TYPE.
	* decl2.c (grok_array_decl): Likewise.

2012-04-17  Marc Glisse  <>

	PR c++/51033
	* c-common.c (convert_vector_to_pointer_for_subscript): New function.
	* c-common.h (convert_vector_to_pointer_for_subscript): Declare it.

2012-04-17  Marc Glisse  <>

	PR c++/51033
	* c-typeck.c (build_array_ref): Call
	* doc/extend.texi (Vector Extensions): Subscripting not just for C.

2012-04-17  Marc Glisse  <>

	PR c++/51033
	* gcc.dg/vector-1.c: Move to ...
	* c-c++-common/vector-1.c: ... here.
	* gcc.dg/vector-2.c: Move to ...
	* c-c++-common/vector-2.c: ... here.
	* gcc.dg/vector-3.c: Move to ...
	* c-c++-common/vector-3.c: ... here. Adapt to C++.
	* gcc.dg/vector-4.c: Move to ...
	* c-c++-common/vector-4.c: ... here.
	* gcc.dg/vector-init-1.c: Move to ...
	* c-c++-common/vector-init-1.c: ... here.
	* gcc.dg/vector-init-2.c: Move to ...
	* c-c++-common/vector-init-2.c: ... here.
	* gcc.dg/vector-subscript-1.c: Move to ... Adapt to C++.
	* c-c++-common/vector-subscript-1.c: ... here.
	* gcc.dg/vector-subscript-2.c: Move to ...
	* c-c++-common/vector-subscript-2.c: ... here.
	* gcc.dg/vector-subscript-3.c: Move to ...
	* c-c++-common/vector-subscript-3.c: ... here.

-- Marc Glisse

Attachment: p8
Description: Text document

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