This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51033] generic vector subscript and shuffle support was not added to C++
- From: "marc.glisse at normalesup dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 17 Apr 2012 10:22:07 +0000
- Subject: [Bug c++/51033] generic vector subscript and shuffle support was not added to C++
- Auto-submitted: auto-generated
- References: <bug-51033-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033
--- Comment #10 from Marc Glisse <marc.glisse at normalesup dot org> 2012-04-17 10:22:07 UTC ---
Created attachment 27176
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27176
subscript
This patch (a simple copy of a paragraph from the C front-end) seems sufficient
to add vector subscript support to the C++ front-end. At least, on the related
testcases I could find in the testsuite (vector-init-2.c,
vector-subscript-[123].c), g++ produces the same results as gcc (some error
messages have different content, but the same meaning, and the carets point to
'[' in C and ']' in C++).
I don't know if any of the functions called have more idiomatic counterparts in
the C++ front-end.
__builtin_shuffle seems a bit harder to move for someone not familiar with the
code.
Note that in C++ operator[] can only be a member function, which means we don't
need to worry about overloading or anything like that.