This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [c++-concepts] code review
- From: Jason Merrill <jason at redhat dot com>
- To: Andrew Sutton <andrew dot n dot sutton at gmail dot com>
- Cc: Gabriel Dos Reis <gdr at integrable-solutions dot net>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 19 Jun 2013 10:21:13 -0400
- Subject: Re: [c++-concepts] code review
- References: <CANq5Syt5s-NgazOYbT5wtYSRsbZUqcivoer1w4jiucx5qYKMfA at mail dot gmail dot com> <CAAiZkiAn9rpPmPKXztUA4rd3CH6w3=tn7jz=oksk65Ypx6RpGg at mail dot gmail dot com> <51B0B0ED dot 5090508 at redhat dot com> <CANq5SystWWs=AOAYAHmRjfx17itDrYQj+GtdUr=-XYGLV_4=6g at mail dot gmail dot com> <51B0F122 dot 6020301 at redhat dot com> <CANq5SysFjY39osn-Xp3HXE-Due7C=D2-VKrhjKdLtpws8rH=mg at mail dot gmail dot com> <51B62961 dot 1080409 at redhat dot com> <CAAiZkiDY5LZRwgEAmc1VPhbMXJ1ytU_Q2Fj9tSyN1M_T7NMMfw at mail dot gmail dot com> <51B8A36C dot 1080005 at redhat dot com> <CANq5SyuWOKxWshSBb8uxtN8d6HMgifJdDcQSrsSwazRjE=v2NQ at mail dot gmail dot com> <51BBC613 dot 5040708 at redhat dot com> <CANq5SysgoJ0nVdrqLMjFqaWcmz97dB03qbKCs_ZpoBS+OVYzfg at mail dot gmail dot com> <51BF617D dot 3080101 at redhat dot com> <CANq5SyshsCtsQgGvCj6hVexa4m-st0-yM1PpLq=R68YXkfz_aw at mail dot gmail dot com>
On 06/18/2013 12:27 PM, Andrew Sutton wrote:
There was a bug in instantiation_dependent_expr_r that would cause
trait expressions like __is_class(int) to be marked as type dependent.
It was always testing the 2nd operand, even for unary traits
(NULL_TREE turns out to be type dependent).
I fixed that last month:
2013-05-20 Jason Merrill <jason@redhat.com>
PR c++/57016
* pt.c (instantiation_dependent_r) [TRAIT_EXPR]: Only check
type2 if there is one.
If you want to keep the is_binary_trait stuff, that's fine, except that
+extern bool is_binary_trait (cp_trait_kind);
...
+inline bool
+is_binary_trait (cp_trait_kind k)
violates the rules for inline functions: an inline function must be
declared as inline before any uses and defined in all translation units
that use it.
+// reduced terms in the constraints language. Note that conjoining with a
+// non-null expression with NULL_TREE is an identity operation. That is,
Drop the first "with".
+ // If the types of the underlying templates match, compare
+ // their constraints. The declarations could differ there.
+ if (types_match)
+ types_match = equivalent_constraints (get_constraints (olddecl),
+ current_template_reqs);
We can't assume that current_template_reqs will always apply to newdecl
here, as decls_match is called in overload resolution as well. What's
the problem with attaching the requirements to the declaration before we
get to duplicate_decls?
Jason