diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-04-15 08:07:05 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-04-15 08:07:05 +0000 |
commit | b5b42233b31539367d1d1467e1c78a2800ed5d27 (patch) | |
tree | 2b8e89b191bde58b66f90deed6faa880079cd76d /gcc/cp | |
parent | 058672f818da2e2fd3eed44737939291cc02d809 (diff) | |
download | gcc-b5b42233b31539367d1d1467e1c78a2800ed5d27.tar.gz |
2016-04-15 Basile Starynkevitch <basile@starynkevitch.net>
{{merging with even more of GCC 6, using subversion 1.9
svn merge -r229701:229740 ^/trunk
}}
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@235007 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 14 | ||||
-rw-r--r-- | gcc/cp/parser.c | 4 | ||||
-rw-r--r-- | gcc/cp/pt.c | 13 |
3 files changed, 31 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ad7087ee58c..86c3653aff6 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,17 @@ +2015-11-03 Jason Merrill <jason@redhat.com> + + * pt.c (struct find_parameter_pack_data): Add + type_pack_expansion_p field. + (find_parameter_packs_r): Use it to turn 'auto' into a parameter pack. + (uses_parameter_packs, make_pack_expansion) + (check_for_bare_parameter_packs, fixed_parameter_pack_p): Set it. + +2015-11-03 Thomas Schwinge <thomas@codesourcery.com> + Chung-Lin Tang <cltang@codesourcery.com> + + * parser.c (cp_parser_omp_construct, cp_parser_pragma): Handle + PRAGMA_OACC_ATOMIC. + 2015-10-31 Ville Voutilainen <ville.voutilainen@gmail.com> Remove the implementation of N3994, terse range-for loops. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 947b72c4678..313a8453c54 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -35464,6 +35464,9 @@ cp_parser_omp_construct (cp_parser *parser, cp_token *pragma_tok) switch (pragma_tok->pragma_kind) { + case PRAGMA_OACC_ATOMIC: + cp_parser_omp_atomic (parser, pragma_tok); + return; case PRAGMA_OACC_CACHE: stmt = cp_parser_oacc_cache (parser, pragma_tok); break; @@ -36040,6 +36043,7 @@ cp_parser_pragma (cp_parser *parser, enum pragma_context context) cp_parser_omp_declare (parser, pragma_tok, context); return false; + case PRAGMA_OACC_ATOMIC: case PRAGMA_OACC_CACHE: case PRAGMA_OACC_DATA: case PRAGMA_OACC_ENTER_DATA: diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index e836ec747d0..bc1ba2f38d8 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -3407,6 +3407,9 @@ struct find_parameter_pack_data /* Set of AST nodes that have been visited by the traversal. */ hash_set<tree> *visited; + + /* True iff we're making a type pack expansion. */ + bool type_pack_expansion_p; }; /* Identifies all of the argument packs that occur in a template @@ -3443,6 +3446,12 @@ find_parameter_packs_r (tree *tp, int *walk_subtrees, void* data) case TEMPLATE_TYPE_PARM: t = TYPE_MAIN_VARIANT (t); case TEMPLATE_TEMPLATE_PARM: + /* If the placeholder appears in the decl-specifier-seq of a function + parameter pack (14.6.3), or the type-specifier-seq of a type-id that + is a pack expansion, the invented template parameter is a template + parameter pack. */ + if (ppd->type_pack_expansion_p && is_auto_or_concept (t)) + TEMPLATE_TYPE_PARAMETER_PACK (t) = true; if (TEMPLATE_TYPE_PARAMETER_PACK (t)) parameter_pack_p = true; break; @@ -3577,6 +3586,7 @@ uses_parameter_packs (tree t) struct find_parameter_pack_data ppd; ppd.parameter_packs = ¶meter_packs; ppd.visited = new hash_set<tree>; + ppd.type_pack_expansion_p = false; cp_walk_tree (&t, &find_parameter_packs_r, &ppd, ppd.visited); delete ppd.visited; return parameter_packs != NULL_TREE; @@ -3686,6 +3696,7 @@ make_pack_expansion (tree arg) /* Determine which parameter packs will be expanded. */ ppd.parameter_packs = ¶meter_packs; ppd.visited = new hash_set<tree>; + ppd.type_pack_expansion_p = TYPE_P (arg); cp_walk_tree (&arg, &find_parameter_packs_r, &ppd, ppd.visited); delete ppd.visited; @@ -3733,6 +3744,7 @@ check_for_bare_parameter_packs (tree t) ppd.parameter_packs = ¶meter_packs; ppd.visited = new hash_set<tree>; + ppd.type_pack_expansion_p = false; cp_walk_tree (&t, &find_parameter_packs_r, &ppd, ppd.visited); delete ppd.visited; @@ -4772,6 +4784,7 @@ fixed_parameter_pack_p (tree parm) struct find_parameter_pack_data ppd; ppd.parameter_packs = ¶meter_packs; ppd.visited = new hash_set<tree>; + ppd.type_pack_expansion_p = false; fixed_parameter_pack_p_1 (parm, &ppd); |