diff mbox

C++ PATCH for Concepts TS multiple auto

Message ID 5634E930.6080700@redhat.com
State New
Headers show

Commit Message

Jason Merrill Oct. 31, 2015, 4:15 p.m. UTC
The Concepts TS extends 'auto' deduction so that auto, or a 
constrained-type-specifier, can appear anywhere in the type of a 
declaration, rather than only as a type-specifier.  This was already 
implemented for function parameters; this patch implements it for 
variables as well.  Use of a constrained-type-specifier as a placeholder 
for a non-type or template template argument is not supported yet, however.

The second patch is a prerequisite, changing for_each_template_parameter 
to return a tree value rather than 1 or 0.

The third and fourth patches are small bits I noticed while working on 
this: the third improves the error messages for auto deduction failure 
and the fourth uses the hash function on the template's UID rather than 
using it directly as the seed.

Tested x86_64-pc-linux-gnu, applying to trunk.
diff mbox

Patch

commit 82a9072ecc7393b141b6923abe22820c7d813498
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Oct 30 14:55:57 2015 -0400

    	* pt.c (hash_tmpl_and_args): Use iterative_hash_object on template
    	uid.

diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 438ec2d..243464d 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -1682,7 +1682,7 @@  spec_hasher::equal (spec_entry *e1, spec_entry *e2)
 static hashval_t
 hash_tmpl_and_args (tree tmpl, tree args)
 {
-  hashval_t val = DECL_UID (tmpl);
+  hashval_t val = iterative_hash_object (DECL_UID (tmpl), 0);
   return iterative_hash_template_arg (args, val);
 }