Commit c6569cd0 by Jason Merrill Committed by Jason Merrill

re PR c++/43143 ([c++0x] array value-initialization and variadics)

	PR c++/43143
	* typeck2.c (digest_init_r): Accept value init of array.

From-SVN: r157015
parent 3adcf52c
2010-02-23 Jason Merrill <jason@redhat.com>
PR c++/43143
* typeck2.c (digest_init_r): Accept value init of array.
2010-02-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/43126
* typeck.c (convert_arguments): Update error message.
2010-02-22 Mike Stump <mikestump@comcast.net>
......
......@@ -929,10 +929,12 @@ digest_init_r (tree type, tree init, bool nested, int flags)
}
if (TREE_CODE (type) == ARRAY_TYPE
&& TREE_CODE (init) != CONSTRUCTOR)
&& !BRACE_ENCLOSED_INITIALIZER_P (init))
{
/* Allow the result of build_array_copy. */
if (TREE_CODE (init) == TARGET_EXPR
/* Allow the result of build_array_copy and of
build_value_init_noctor. */
if ((TREE_CODE (init) == TARGET_EXPR
|| TREE_CODE (init) == CONSTRUCTOR)
&& (same_type_ignoring_top_level_qualifiers_p
(type, TREE_TYPE (init))))
return init;
......
2010-02-23 Jason Merrill <jason@redhat.com>
PR c++/43143
* g++.dg/cpp0x/variadic100.C: New.
2010-02-23 Jason Merrill <jason@redhat.com>
PR debug/42800
* gcc.dg/debug/dwarf2/dwarf2.exp: Run c-c++-common dwarf2 tests.
* g++.dg/debug/dwarf2/dwarf2.exp: Likewise.
......
// PR c++/43143
// { dg-options "-std=c++0x" }
template<typename T>
T&& declval();
template<class T, class... Args>
void test() {
T t(declval<Args>()...);
}
int main() {
test<const int>(); // OK
test<int[23]>(); // Error
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment