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: Sun, 22 Apr 2012 15:09:23 +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 #22 from Marc Glisse <marc.glisse at normalesup dot org> 2012-04-22 15:09:23 UTC ---
(In reply to comment #20)
> And then I still need to write a cxx_eval_vec_perm function so the result of
> __builtin_shuffle can be constexpr. I haven't seen how the C front-end handles
> shuffles of constants. Maybe a "sorry" would do for now.
Making vectors literals is too much for now, the following seems sufficient as
long as they are not.
--- cp/semantics.c (revision 186667)
+++ cp/semantics.c (working copy)
@@ -8262,10 +8262,11 @@ potential_constant_expression_1 (tree t,
case TRANSACTION_EXPR:
case IF_STMT:
case DO_STMT:
case FOR_STMT:
case WHILE_STMT:
+ case VEC_PERM_EXPR:
if (flags & tf_error)
error ("expression %qE is not a constant-expression", t);
return false;
case TYPEID_EXPR: