mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-15 02:50:22 +08:00
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
This commit is contained in:
parent
3adcf52c82
commit
c6569cd04e
@ -1,8 +1,12 @@
|
||||
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;
|
||||
|
@ -1,3 +1,8 @@
|
||||
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
|
||||
|
15
gcc/testsuite/g++.dg/cpp0x/variadic100.C
Normal file
15
gcc/testsuite/g++.dg/cpp0x/variadic100.C
Normal file
@ -0,0 +1,15 @@
|
||||
// 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
|
||||
}
|
Loading…
Reference in New Issue
Block a user