[pushed] c++: vector compound literal [PR105187]
Commit Message
My cleanup in r12-296 cleared TREE_HAS_CONSTRUCTOR on digested class
initializers, but we leave it set for vectors, since we can't wrap them in
TARGET_EXPR.
Tested x86_64-pc-linux-gnu, applying to trunk.
PR c++/105187
gcc/cp/ChangeLog:
* typeck2.cc (store_init_value): Allow TREE_HAS_CONSTRUCTOR for
vectors.
gcc/testsuite/ChangeLog:
* gcc.c-torture/compile/20050113-1.c: Moved to...
* c-c++-common/torture/20050113-1.c: ...here.
---
gcc/cp/typeck2.cc | 1 +
.../{gcc.c-torture/compile => c-c++-common/torture}/20050113-1.c | 0
2 files changed, 1 insertion(+)
rename gcc/testsuite/{gcc.c-torture/compile => c-c++-common/torture}/20050113-1.c (100%)
base-commit: cc76c502a761ddaee215bcbd8fe4720e46d3b9dd
@@ -922,6 +922,7 @@ store_init_value (tree decl, tree init, vec<tree, va_gc>** cleanups, int flags)
here it should have been digested into an actual value for the type. */
gcc_checking_assert (TREE_CODE (value) != CONSTRUCTOR
|| processing_template_decl
+ || TREE_CODE (type) == VECTOR_TYPE
|| !TREE_HAS_CONSTRUCTOR (value));
/* If the initializer is not a constant, fill in DECL_INITIAL with
similarity index 100%
rename from gcc/testsuite/gcc.c-torture/compile/20050113-1.c
rename to gcc/testsuite/c-c++-common/torture/20050113-1.c