aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/typeck.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2015-10-31 12:20:05 -0400
committerJason Merrill <jason@gcc.gnu.org>2015-10-31 12:20:05 -0400
commit4fea442db740d66cd8d16bdeb667d9725f305844 (patch)
tree58ced5bf7feb8ee0c6ac2b1c7d216ad00966909d /gcc/cp/typeck.c
parenta459b07fa440fcb449e9b65cf0cc649905b6ba9e (diff)
downloadgcc-4fea442db740d66cd8d16bdeb667d9725f305844.zip
gcc-4fea442db740d66cd8d16bdeb667d9725f305844.tar.gz
gcc-4fea442db740d66cd8d16bdeb667d9725f305844.tar.bz2
Implement multiple 'auto' feature from Concepts TS.
* parser.c (cp_parser_type_id_1): Allow 'auto' if -fconcepts. (cp_parser_template_type_arg): Likewise. (get_concept_from_constraint): Split out most logic to... * constraint.cc (placeholder_extract_concept_and_args): ...here. (equivalent_placeholder_constraints, hash_placeholder_constraint): New. * cxx-pretty-print.c (pp_cxx_constrained_type_spec): New. * cxx-pretty-print.h: Declare it. * error.c (dump_type) [TEMPLATE_TYPE_PARM]: Call it. * pt.c (is_auto_r, extract_autos_r, extract_autos, auto_hash): New. (type_uses_auto): Use is_auto_r. (do_auto_deduction): Handle multiple 'auto's if -fconcepts. * typeck.c (structural_comptypes) [TEMPLATE_TYPE_PARM]: Compare constraints. From-SVN: r229629
Diffstat (limited to 'gcc/cp/typeck.c')
-rw-r--r--gcc/cp/typeck.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 9d043e0..e68e9df 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -1333,6 +1333,10 @@ structural_comptypes (tree t1, tree t2, int strict)
template parameters set, they can't be equal. */
if (!comp_template_parms_position (t1, t2))
return false;
+ /* Constrained 'auto's are distinct from parms that don't have the same
+ constraints. */
+ if (!equivalent_placeholder_constraints (t1, t2))
+ return false;
break;
case TYPENAME_TYPE: