This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [genmatch] reject duplicate captures used as arguments in user-defined predicates


On Tue, 29 Mar 2016, Prathamesh Kulkarni wrote:

> Hi,
> I suppose we should reject duplicate captures used as "arguments" in user
> defined predicates ?
> eg:
> (match (foo @0 @0)
>   match-template)
> The attached patch prints error "duplicate capture id" for above pattern.
> Bootstrapped+tested on x86_64-pc-linux-gnu.
> Ok for trunk ?

Using a duplicate probably doesn't make sense but it works just fine.
You get res_args[0] == res_args[1] == @0 in the above case.

Richard.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]