diff mbox

[C++] Reimplement ADL

Message ID d80ac7d6-c4e7-edb9-845d-c550e686d16c@acm.org
State New
Headers show

Commit Message

Nathan Sidwell May 26, 2017, 11:35 a.m. UTC
On 05/26/2017 03:54 AM, Jakub Jelinek wrote:
> On Thu, May 25, 2017 at 09:03:31AM -0400, Nathan Sidwell wrote:
>> This patch reimplements ADL.

> I believe this broke
> FAIL: libgomp.c++/udr-12.C (test for excess errors)
> UNRESOLVED: libgomp.c++/udr-12.C compilation failed to produce executable

In answer to my own question, Yes. Yes we should ADL the type.

Fixed thusly.

nathan

Comments

Jakub Jelinek May 26, 2017, 11:49 a.m. UTC | #1
On Fri, May 26, 2017 at 07:35:47AM -0400, Nathan Sidwell wrote:
> On 05/26/2017 03:54 AM, Jakub Jelinek wrote:
> > On Thu, May 25, 2017 at 09:03:31AM -0400, Nathan Sidwell wrote:
> > > This patch reimplements ADL.
> 
> > I believe this broke
> > FAIL: libgomp.c++/udr-12.C (test for excess errors)
> > UNRESOLVED: libgomp.c++/udr-12.C compilation failed to produce executable
> 
> In answer to my own question, Yes. Yes we should ADL the type.
> 
> Fixed thusly.

Thanks.

> 2017-05-26  Nathan Sidwell  <nathan@acm.org>
> 
> 	* name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.
> 
> Index: name-lookup.c
> ===================================================================
> --- name-lookup.c	(revision 248488)
> +++ name-lookup.c	(working copy)
> @@ -998,9 +998,11 @@ name_lookup::search_adl (tree fns, vec<t
>    tree arg;
>  
>    FOR_EACH_VEC_ELT_REVERSE (*args, ix, arg)
> -    /* OMP reduction operators put a type as the first arg.  I don't
> -       suppose we should ADL on that?  */
> -    if (!TYPE_P (arg))
> +    /* OMP reduction operators put an ADL-significant type as the
> +       first arg. */
> +    if (TYPE_P (arg))
> +      adl_type (arg);
> +    else
>        adl_expr (arg);
>  
>    delete fn_set;


	Jakub
diff mbox

Patch

2017-05-26  Nathan Sidwell  <nathan@acm.org>

	* name-lookup.c (name_lookup::search_adl): ADL OMP UDR type args.

Index: name-lookup.c
===================================================================
--- name-lookup.c	(revision 248488)
+++ name-lookup.c	(working copy)
@@ -998,9 +998,11 @@  name_lookup::search_adl (tree fns, vec<t
   tree arg;
 
   FOR_EACH_VEC_ELT_REVERSE (*args, ix, arg)
-    /* OMP reduction operators put a type as the first arg.  I don't
-       suppose we should ADL on that?  */
-    if (!TYPE_P (arg))
+    /* OMP reduction operators put an ADL-significant type as the
+       first arg. */
+    if (TYPE_P (arg))
+      adl_type (arg);
+    else
       adl_expr (arg);
 
   delete fn_set;