mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-21 14:50:57 +08:00
re PR c++/59435 (sizeof...(T) as default value for an argument in the constructor does not work)
/cp 2013-12-09 Paolo Carlini <paolo.carlini@oracle.com> PR c++/59435 * parser.c (cp_parser_cache_defarg): sizeof ... ( p ) can occur in a default argument too. /testsuite 2013-12-09 Paolo Carlini <paolo.carlini@oracle.com> PR c++/59435 * g++.dg/cpp0x/variadic-sizeof3.C: New. From-SVN: r205836
This commit is contained in:
parent
ca0a2d5d0d
commit
f0c6059cdc
@ -1,3 +1,9 @@
|
||||
2013-12-09 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/59435
|
||||
* parser.c (cp_parser_cache_defarg): sizeof ... ( p ) can
|
||||
occur in a default argument too.
|
||||
|
||||
2013-12-06 Caroline Tice <cmtice@google.com>
|
||||
|
||||
Submitting patch from Stephen Checkoway, s@cs.jhu.edu
|
||||
|
@ -24513,7 +24513,7 @@ cp_parser_cache_defarg (cp_parser *parser, bool nsdmi)
|
||||
case CPP_CLOSE_SQUARE:
|
||||
if (depth == 0
|
||||
/* Handle correctly int n = sizeof ... ( p ); */
|
||||
&& !(nsdmi && token->type == CPP_ELLIPSIS))
|
||||
&& token->type != CPP_ELLIPSIS)
|
||||
done = true;
|
||||
/* Update DEPTH, if necessary. */
|
||||
else if (token->type == CPP_CLOSE_PAREN
|
||||
|
@ -1,3 +1,8 @@
|
||||
2013-12-09 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/59435
|
||||
* g++.dg/cpp0x/variadic-sizeof3.C: New.
|
||||
|
||||
2013-12-09 David Malcolm <dmalcolm@redhat.com>
|
||||
|
||||
* g++.dg/plugin/selfassign.c (execute_warn_self_assign): Eliminate
|
||||
|
15
gcc/testsuite/g++.dg/cpp0x/variadic-sizeof3.C
Normal file
15
gcc/testsuite/g++.dg/cpp0x/variadic-sizeof3.C
Normal file
@ -0,0 +1,15 @@
|
||||
// PR c++/59435
|
||||
// { dg-require-effective-target c++11 }
|
||||
|
||||
template <typename... E>
|
||||
struct T
|
||||
{
|
||||
T(unsigned int i = sizeof...(E)){} // does not compile
|
||||
|
||||
static constexpr unsigned int U = sizeof...(E);
|
||||
T(unsigned int j, unsigned int i = U){} // compile
|
||||
};
|
||||
|
||||
template <typename... T>
|
||||
void test(int i = sizeof...(T)) // compile
|
||||
{}
|
Loading…
x
Reference in New Issue
Block a user