diff options
author | Jason Merrill <jason@redhat.com> | 2016-12-21 14:39:04 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2016-12-21 14:39:04 -0500 |
commit | 31bfc9b9dd65ecddff3afa690906d94ef7b773da (patch) | |
tree | 6a4c3f49466411d75b33e5d43dd222039ad777dd /gcc/c-family | |
parent | 3c75aaa3d884ef2cb1dfed57bb3c2a392ece89d5 (diff) | |
download | gcc-31bfc9b9dd65ecddff3afa690906d94ef7b773da.zip gcc-31bfc9b9dd65ecddff3afa690906d94ef7b773da.tar.gz gcc-31bfc9b9dd65ecddff3afa690906d94ef7b773da.tar.bz2 |
Implement P0522R0, matching of template template arguments.
gcc/c-family/
* c.opt (-fnew-ttp-matching): New flag.
* c-opts.c (c_common_post_options): Default on if -std=c++1z.
gcc/cp/
* pt.c (coerce_template_template_parms): Allow a template argument
that's less specialized than the parameter.
(unify_bound_ttp_args): Adjust parm's args to apply to arg's
template.
(coerce_template_args_for_ttp): Split out from
lookup_template_class_1.
(coerce_ttp_args_for_tta, store_defaulted_ttp)
(lookup_defaulted_ttp, add_defaults_to_ttp): New.
(process_partial_specialization): Set DECL_CONTEXT of
template template-parameters.
(coerce_template_parms): Only inform when complain.
(expand_template_argument_pack): Handle error_mark_node.
(convert_template_argument, template_args_equal, unify): Handle
any_targ_node.
* cp-tree.h (enum cp_tree_index): Add CPTI_ANY_TARG.
(any_targ_node): New.
* decl.c (cxx_init_decl_processing): Set it.
* name-lookup.c (consider_binding_level): Ignore names with embedded
spaces.
From-SVN: r243871
Diffstat (limited to 'gcc/c-family')
-rw-r--r-- | gcc/c-family/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c-family/c-opts.c | 4 | ||||
-rw-r--r-- | gcc/c-family/c.opt | 4 |
3 files changed, 13 insertions, 0 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index d8bd2c3..13ba2f3 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2016-12-21 Jason Merrill <jason@redhat.com> + + * c.opt (-fnew-ttp-matching): New flag. + * c-opts.c (c_common_post_options): Default on if -std=c++1z. + 2016-12-14 Martin Jambor <mjambor@suse.cz> * c-omp.c: Include omp-general.h instead of omp-low.h. diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c index 57717ff..62d2f46 100644 --- a/gcc/c-family/c-opts.c +++ b/gcc/c-family/c-opts.c @@ -920,6 +920,10 @@ c_common_post_options (const char **pfilename) if (!global_options_set.x_flag_new_inheriting_ctors) flag_new_inheriting_ctors = abi_version_at_least (11); + /* For GCC 7, only enable DR150 resolution by default if -std=c++1z. */ + if (!global_options_set.x_flag_new_ttp) + flag_new_ttp = (cxx_dialect >= cxx1z); + if (cxx_dialect >= cxx11) { /* If we're allowing C++0x constructs, don't warn about C++98 diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index 33c5def..a5333a3 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -1443,6 +1443,10 @@ C++ ObjC++ Joined Ignore Warn(switch %qs is no longer supported) fnew-abi C++ ObjC++ Ignore Warn(switch %qs is no longer supported) +fnew-ttp-matching +C++ ObjC++ Var(flag_new_ttp) +Implement resolution of DR 150 for matching of template template arguments. + fnext-runtime ObjC ObjC++ LTO Report RejectNegative Var(flag_next_runtime) Generate code for NeXT (Apple Mac OS X) runtime environment. |