diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-11-20 19:58:01 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-11-20 19:58:01 +0100 |
commit | d68ddd2b35078ab61f164b268bac63767b2a8e6a (patch) | |
tree | c5234ca2dab614ccfd0a1f96421fdb36976af8bf /gcc/cp/name-lookup.h | |
parent | 6c7a259b817ea4d1eae117a426a08fc85f943788 (diff) | |
download | gcc-d68ddd2b35078ab61f164b268bac63767b2a8e6a.zip gcc-d68ddd2b35078ab61f164b268bac63767b2a8e6a.tar.gz gcc-d68ddd2b35078ab61f164b268bac63767b2a8e6a.tar.bz2 |
P0329R4: Designated Initialization
P0329R4: Designated Initialization
* parser.c (cp_parser_initializer_clause): List in comment grammar
designated-initializer-list.
(cp_parser_initializer_list): Allow .identifier = without pedwarn for
C++2A, parse .identifier { ... }. Improve location_t argument to
pedwarn. Add pedwarn for [cst] = designators. Diagnose ... in
designated initializer list. Diagnose mixing designated and
non-designated initializer clauses for C++2A. Diagnose duplicated
identifiers in designators.
* name-lookup.h (search_anon_aggr): New declaration.
* name-lookup.c (fields_linear_search): Use search_anon_aggr.
(search_anon_aggr): New function.
* typeck2.c (process_init_constructor_record): Allow designator
to skip over some non-static data members. Handle anonymous
aggregates. Add diagnostics for designator order not matching
member declaration order.
* g++.dg/ext/desig2.C: Adjust comment, no sorry about designator
refering to second member.
(b): New variable and associated expected diagnostic.
* g++.dg/ext/desig4.C: For C++2A expect diagnostics.
* g++.dg/ext/desig5.C: Add dg-do dg-compile and empty dg-options.
* g++.dg/ext/desig8.C: Likewise.
* g++.dg/ext/desig9.C: New test.
* g++.dg/ext/pr27019.C: Don't expect any diagnostics.
* g++.dg/init/error2.C: Adjust expected diagnostics.
* g++.dg/cpp0x/desig1.C: Add dg-options with -pedantic, expect
warning on C99 designators.
* g++.dg/cpp2a/desig1.C: New test.
* g++.dg/cpp2a/desig2.C: New test.
* g++.dg/cpp2a/desig3.C: New test.
* g++.dg/cpp2a/desig4.C: New test.
* g++.dg/cpp2a/desig5.C: New test.
* g++.dg/cpp2a/desig6.C: New test.
From-SVN: r254964
Diffstat (limited to 'gcc/cp/name-lookup.h')
-rw-r--r-- | gcc/cp/name-lookup.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/cp/name-lookup.h b/gcc/cp/name-lookup.h index 1fc1280..e209f18 100644 --- a/gcc/cp/name-lookup.h +++ b/gcc/cp/name-lookup.h @@ -307,6 +307,7 @@ extern void pop_decl_namespace (void); extern void do_namespace_alias (tree, tree); extern tree do_class_using_decl (tree, tree); extern tree lookup_arg_dependent (tree, tree, vec<tree, va_gc> *); +extern tree search_anon_aggr (tree, tree); extern tree get_class_binding_direct (tree, tree, int type_or_fns = -1); extern tree get_class_binding (tree, tree, int type_or_fns = -1); extern tree *get_member_slot (tree klass, tree name); |