From patchwork Tue May 5 15:01:59 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waffl3x X-Patchwork-Id: 134488 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id B88694BA5436 for ; Tue, 5 May 2026 15:11:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B88694BA5436 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=baylibre-com.20251104.gappssmtp.com header.i=@baylibre-com.20251104.gappssmtp.com header.a=rsa-sha256 header.s=20251104 header.b=T67MG8fA X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by sourceware.org (Postfix) with ESMTPS id 5A2BF4BA900E for ; Tue, 5 May 2026 15:10:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5A2BF4BA900E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=baylibre.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5A2BF4BA900E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::435 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777993843; cv=none; b=fM0g7SaC6S7zCOXijWb1TeHRiZ9IY7TI8W17+A7JaF0+xvbEGvWZu/w/yLLSLsnASLsdGCHsFDwUdaejhJ8FOVDDR27PflhuKhtEVlS14AlcXOApKqpYxucPZN2kgdllO5tzcMr4nJWShcKK6GBOWfrI43fVsZZb/pdmK5RdxQE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777993843; c=relaxed/simple; bh=XkqyPNKbct7Xq80C2qckPXdAECkGgnNUCONOIGMupd0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=u0m+Xa26K+rtYTQIpCIYlzguwkZcHQGflAZVkH8U9LZjNb8DGVVvJxm/ssR7o8eY4bxOeBRT5LOdXkhvyOueLWt8/ABdv20TZVMAwbO4Ewi14qqGSLsvl6b7Bbeq49AjerUt7h8BqFLG8B6Av63hJQ1c8n4CYknv7I0YyjSNTp8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5A2BF4BA900E Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-824acdfb73dso414105b3a.2 for ; Tue, 05 May 2026 08:10:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20251104.gappssmtp.com; s=20251104; t=1777993842; x=1778598642; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NY4AKGfBg7OhsvgHP+Fp1lLnyHflwRLlR24CsB1z0rg=; b=T67MG8fAI1Ybn09WlXAX100WjoYZfa76c+xrcT7Et/tl+wrWv/QdNffKZQIe5PWj17 pxjjKF77BxDam7cFs9Zzo4KplxPLfsUGUYC+MgoPrYqlSAm77WPTUPFsWh6Mm2sMgGWU ZaHqGlWEU0ekzdI7uVuNgWNlpt6xPSG0mznYBDMo0N6RIBI5mzqY9m0Ejd6sdABjaIDy 77zt9CHeohWQlFlR7Ekw6VdKUwdDwGqUhmpKKYtxatDRtGBjw5ZCMa1WWGsEoKvIde39 7mQs2VjYXYv+8N7/ZAAa1curK3VuuilNNjPE4ZwshXl/ObTuXPxemL2KJ9CHB49RurSs Yr2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777993842; x=1778598642; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=NY4AKGfBg7OhsvgHP+Fp1lLnyHflwRLlR24CsB1z0rg=; b=LNUqIkvZEhQH7EzTmIRI0rJRNPcbjm4l1aNJqw9bG7lFx1KH/4ROBAYghxqKua+fr9 VlTem874CPuwg+SsNN3NurZtB/N3EXN+/DJbd6O0Mv7lljQACv+XvVGUosuiDkwcoD+M qeUHWQb3/fgMU5Bj5ar5H240OYsJl/xTINCtYAuAMZVJTBdCrUJA2ey80PUKmaoCqWwQ 5Aj7SY/zujGY2TaHWsvwpKtSAhGbkKg3g4tAeTpEEbssP0SuC+tgb4aBdqQ3N+R319NW XverkPVrD8jF9vTeJMPueVmd9DNQBXbYtXTUT/5r4tsV2U1T4D8kxTTqRWy18LFa/5/y ylgA== X-Gm-Message-State: AOJu0YyrqI2hcJX21rqj3P02BBwcZKX5lQXZOjsq33/iw0X6Nlg0yL88 bkYnIAQvZhk+N2mqNMHgZid48qs+jrdrt+vYxwsrwyHaKq6hd2Ztc3tDAmOJ2R/07bN4PLS/83c EelAX X-Gm-Gg: AeBDieuesTdK3bfxN9i+Bykiq8dzJjObINa2A0D21kaiRCGNxNp5SlOscWcQi5npVs4 +kTTUWGU8v1jZUTC8jt3umrfkkCJCPSAAG+j8V/+nBj4w0Q3TDixlUHvoAbezZvxBA/ldeynbnc MY1BtF6lHW9oWiSmt4yHzpsPkMwkzL7ZzGJfGX3hlZxLcKtm/R+09s4c/GcdL1V3wH60/uzCh52 GGBipyqtgiSP6OdHI5YL127/X9rs63Ce+CLvwKBUVHzCafTHQEsy0YnuQawD+vP49jWdSaiduT2 5VuUhGxY4+vORZV6MATTJB7u3MeDtti5VNvWCah6Z6DQ7juYQH+AyDPw9Qv0mqo5X3O/rdLDrDS mpAvtgTBhNHYl3EMlsP/dDuShh6iwhL4TUGHCVLLRIFS55A5F5yb41pWKen0768+8e1W3blDJ0w UF921eZcGI7ncsDgi6NIr1Z0EdiIKyXR9grgHTPlAtAhFRZ8PjFw== X-Received: by 2002:a05:6a00:3e0b:b0:837:73ab:1013 with SMTP id d2e1a72fcca58-83773ab284bmr4457997b3a.6.1777993842173; Tue, 05 May 2026 08:10:42 -0700 (PDT) Received: from waffl3x-prestige.lan ([2001:56a:f98a:b800:1f67:ce08:3cbd:86b8]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-83965645140sm2674956b3a.12.2026.05.05.08.10.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2026 08:10:41 -0700 (PDT) From: Waffl3x To: gcc-patches@gcc.gnu.org Cc: Waffl3x Subject: [PATCH 06/12] OpenMP/C++: Force location wrapper on 'omp allocate' directive clauses Date: Tue, 5 May 2026 09:01:59 -0600 Message-ID: <20260505151030.1749548-7-waffl3x@baylibre.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260505151030.1749548-1-waffl3x@baylibre.com> References: <20260505151030.1749548-1-waffl3x@baylibre.com> MIME-Version: 1.0 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org Some nodes, such as template parameters, don't get wrapped by maybe_wrap_with_location. We rely on location wrappers for diagnostics of clause exprs in finish_omp_allocate, the easiest solution is to force a wrapper by replicating the the mechanisms of maybe_wrap_with_location in cp_parser_omp_allocate. Unfortuntely, tsubst_expr uses maybe_wrap_with_location to rewrap location wrappers, stripping wrappers that we previously forced. This patch solves that by handling wrappers explicitly in tsubst_expr's OMP_ALLOCATE case. This is kind of a kludge, if this is deemed to be a good solution we should possibly split it out into its own function (force_wrap_with_location?) and change tsubst_expr to use that for rewrapping. This would be trivial to do, but belongs in a different patch. gcc/cp/ChangeLog: * parser.cc (cp_parser_omp_allocate): Force a location wrapper. * pt.cc (tsubst_stmt): Rewrap location wrappers after tsubst_expr. gcc/testsuite/ChangeLog: * g++.dg/gomp/allocate-10.C: Remove xfails. * g++.dg/gomp/allocate-14.C: Likewise. * g++.dg/gomp/allocate-17.C: Likewise. Signed-off-by: Waffl3x --- gcc/cp/parser.cc | 26 +++++++++++++++-- gcc/cp/pt.cc | 24 ++++++++++++---- gcc/testsuite/g++.dg/gomp/allocate-10.C | 12 +++----- gcc/testsuite/g++.dg/gomp/allocate-14.C | 37 +++++++++++-------------- gcc/testsuite/g++.dg/gomp/allocate-17.C | 23 +++++++-------- 5 files changed, 73 insertions(+), 49 deletions(-) diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc index 924e52da6ea..412a71c439c 100644 --- a/gcc/cp/parser.cc +++ b/gcc/cp/parser.cc @@ -47373,13 +47373,35 @@ cp_parser_omp_allocate (cp_parser *parser, cp_token *pragma_tok) } while (true); cp_parser_require_pragma_eol (parser, pragma_tok); + /* Some codes, such as template parameters, don't get wrapped by + maybe_wrap_with_location despite not being able to carry a location. + We need a location to issue good diagnostics in finish_omp_allocate. */ + auto maybe_force_wrap_with_location = [] (cp_expr expr_with_loc) -> tree + { + tree expr = expr_with_loc.get_value (); + if (!expr || error_operand_p (expr)) + return expr; + /* In most situations, expr will already have been wrapped. */ + if (CAN_HAVE_LOCATION_P (expr)) + return expr; + + location_t expr_loc = expr_with_loc.get_location (); + /* Copied from tree.cc:maybe_wrap_with_location. */ + const tree_code code + = (((CONSTANT_CLASS_P (expr) && TREE_CODE (expr) != STRING_CST) + || (TREE_CODE (expr) == CONST_DECL && !TREE_STATIC (expr))) + ? NON_LVALUE_EXPR : VIEW_CONVERT_EXPR); + tree wrapper = build1_loc (expr_loc, code, TREE_TYPE (expr), expr); + EXPR_LOCATION_WRAPPER_P (wrapper) = 1; + return wrapper; + }; /* We can still diagnose some things about allocator/alignment even if nl is NULL_TREE. */ finish_omp_allocate (pragma_tok->location, nl, - allocator, - alignment, + maybe_force_wrap_with_location (allocator), + maybe_force_wrap_with_location (alignment), directive_ctx); } diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc index aa41a46e007..d27f3c1118f 100644 --- a/gcc/cp/pt.cc +++ b/gcc/cp/pt.cc @@ -20469,11 +20469,25 @@ tsubst_stmt (tree t, tree args, tsubst_flags_t complain, tree in_decl) case OMP_ALLOCATE: { gcc_assert (flag_openmp); - - tree alloc - = tsubst_expr (OMP_ALLOCATE_ALLOCATOR (t), args, complain, in_decl); - tree align - = tsubst_expr (OMP_ALLOCATE_ALIGN (t), args, complain, in_decl); + /* We force a location wrapper in some cases that don't get wrapped by + maybe_wrap_with_location, tsubst_expr doesn't rewrap them in those + cases so we have to do it. */ + auto subst_and_rewrap = [&] (const tree expr) + { + if (!expr || expr == error_mark_node) + return expr; + tree ret = tsubst_expr (tree_strip_any_location_wrapper (expr), + args, complain, in_decl); + if (location_wrapper_p (expr) && !CAN_HAVE_LOCATION_P (ret)) + { + ret = build1_loc (EXPR_LOCATION (expr), TREE_CODE (expr), + TREE_TYPE (ret), ret); + EXPR_LOCATION_WRAPPER_P (ret) = 1; + } + return ret; + }; + tree alloc = subst_and_rewrap (OMP_ALLOCATE_ALLOCATOR (t)); + tree align = subst_and_rewrap (OMP_ALLOCATE_ALIGN (t)); tree vars = copy_list (OMP_ALLOCATE_VARS (t)); for (tree node = vars; node != NULL_TREE; node = TREE_CHAIN (node)) { diff --git a/gcc/testsuite/g++.dg/gomp/allocate-10.C b/gcc/testsuite/g++.dg/gomp/allocate-10.C index e0f3bcc1780..27f739df6a5 100644 --- a/gcc/testsuite/g++.dg/gomp/allocate-10.C +++ b/gcc/testsuite/g++.dg/gomp/allocate-10.C @@ -34,7 +34,7 @@ void auto_nttp_allocator_static_0() static int a; #pragma omp allocate(a) allocator(Alloc) /* { dg-error "invalid conversion from 'int' to 'omp_allocator_handle_t'" "" { target *-*-* } .-1 } */ - /* { dg-error "'allocator' clause requires a constant predefined allocator" "" { xfail *-*-* } .-2 } */ + /* { dg-error "'allocator' clause requires a constant predefined allocator" "" { target *-*-* } .-2 } */ } template @@ -49,7 +49,7 @@ void auto_nttp_allocator_static_2() { static int a; #pragma omp allocate(a) allocator(Alloc) - /* { dg-error "'allocator' clause requires a constant predefined allocator" "" { xfail *-*-* } .-1 } */ + /* { dg-error "'allocator' clause requires a constant predefined allocator" "" { target *-*-* } .-1 } */ } template @@ -76,8 +76,6 @@ void instantiate_auto_nttp_allocator_static() #undef DEFINITELY_NOT_PREDEFINED -/* { dg-bogus "'allocator' clause requires a constant predefined allocator" "" { xfail *-*-* } 0 } */ - /* Invalid align clause */ template @@ -91,7 +89,7 @@ template void auto_nttp_align_0() { int a; - #pragma omp allocate(a) align(Align) /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { xfail *-*-* } } */ + #pragma omp allocate(a) align(Align) /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { target *-*-* } } */ } template @@ -99,7 +97,7 @@ void auto_nttp_align_1() { int a; #pragma omp allocate(a) align(Align) - /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { xfail *-*-* } .-1 } */ + /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { target *-*-* } .-1 } */ /* { dg-error {could not convert 'nullptr' from 'std::nullptr_t' to '(?:long )?unsigned int'} "" { target *-*-* } .-2 } */ } @@ -111,5 +109,3 @@ void instantiate_auto_nttp_align() auto_nttp_align_1<32>(); /* { dg-bogus "required from here" } */ auto_nttp_align_1(); /* { dg-message "required from here" } */ } - -/* { dg-bogus "'align' clause argument needs to be positive constant power of two integer expression" "" { xfail *-*-* } 0 } */ diff --git a/gcc/testsuite/g++.dg/gomp/allocate-14.C b/gcc/testsuite/g++.dg/gomp/allocate-14.C index d40288d957d..a622adc34d9 100644 --- a/gcc/testsuite/g++.dg/gomp/allocate-14.C +++ b/gcc/testsuite/g++.dg/gomp/allocate-14.C @@ -121,9 +121,9 @@ void nttp_allocator_static() { static int a; /* { dg-note "'a' declared here" } */ #pragma omp allocate(a) allocator(Alloc) - /* { dg-error "'allocator' clause requires a constant predefined allocator" "" { xfail *-*-* } .-1 } */ + /* { dg-error "'allocator' clause requires a constant predefined allocator" "" { target *-*-* } .-1 } */ /* { dg-note "because one or more variables with static storage duration appear in the 'allocate' directive" "" { target *-*-* } .-2 } */ - /* { dg-note "expression evaluates to '1024'" "" { xfail *-*-* } .-3 }*/ + /* { dg-note "expression evaluates to '1024'" "" { target *-*-* } .-3 }*/ } template @@ -145,9 +145,9 @@ void nttp_dependent_type_allocator_static_0() { static int a; /* { dg-note "'a' declared here" } */ #pragma omp allocate(a) allocator(Alloc) - /* { dg-error "'allocator' clause requires a constant predefined allocator" "" { xfail *-*-* } .-1 } */ + /* { dg-error "'allocator' clause requires a constant predefined allocator" "" { target *-*-* } .-1 } */ /* { dg-note "because one or more variables with static storage duration appear in the 'allocate' directive" "" { target *-*-* } .-2 } */ - /* { dg-note "expression evaluates to '1024'" "" { xfail *-*-* } .-3 }*/ + /* { dg-note "expression evaluates to '1024'" "" { target *-*-* } .-3 }*/ } template @@ -266,7 +266,7 @@ template void nttp_align() { int a; - #pragma omp allocate(a) align(Align) /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { xfail *-*-* } } */ + #pragma omp allocate(a) align(Align) /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" } */ } template @@ -289,7 +289,7 @@ template void nttp_dependent_type_align_0() { int a; - #pragma omp allocate(a) align(Align) /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { xfail *-*-* } } */ + #pragma omp allocate(a) align(Align) /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" } */ } template @@ -420,7 +420,7 @@ void all_dependent_2() int b = 42; Var a = b; #pragma omp allocate(a) allocator(Alloc) align(Align) - /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { xfail *-*-* } .-1 } */ + /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { target *-*-* } .-1 } */ } template void templ_no_vars_dep_align_invalid() { #pragma omp allocate() align(Align) /* { dg-error "expected unqualified-id before '\\\)' token" } */ - /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { xfail *-*-* } .-1 } */ + /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { target *-*-* } .-1 } */ } template void templ_no_vars_dep_align_invalid<42>(); @@ -876,7 +876,7 @@ template void templ_invalid_vars_param_dependent_align_invalid(int p) /* { dg-note "parameter 'p' declared here" } */ { #pragma omp allocate(p) align(Align) /* { dg-error "function parameter 'p' may not appear as list item in an 'allocate' directive" } */ - /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { xfail *-*-* } .-1 } */ + /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { target *-*-* } .-1 } */ } template void templ_invalid_vars_param_dependent_align_invalid<42>(int); @@ -908,7 +908,7 @@ void templ_invalid_vars_out_of_scope_dependent_align_invalid() int a; /* { dg-note "declared here" } */ { #pragma omp allocate(a) align(Align) /* { dg-error "'allocate' directive must be in the same scope as 'a'" } */ - /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { xfail *-*-* } .-1 } */ + /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { target *-*-* } .-1 } */ } } template void templ_invalid_vars_out_of_scope_dependent_align_invalid<42>(); @@ -944,7 +944,7 @@ void templ_invalid_vars_out_of_scope_and_param_dependent_align_invalid(int p) /* { #pragma omp allocate(a, p) align(Align) /* { dg-error "'allocate' directive must be in the same scope as 'a'" } */ /* { dg-error "function parameter 'p' may not appear as list item in an 'allocate' directive" "" { target *-*-* } .-1 } */ - /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { xfail *-*-* } .-2 } */ + /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { target *-*-* } .-2 } */ } } template void templ_invalid_vars_out_of_scope_and_param_dependent_align_invalid<42>(int); @@ -1001,7 +1001,7 @@ void multiple_uses_dep_directive_before_invalid_align() { int a; #pragma omp allocate(a) align(Align) /* { dg-note "'a' previously appeared here" } */ - /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { xfail *-*-* } .-1 } */ + /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { target *-*-* } .-1 } */ #pragma omp allocate(a) /* { dg-error "'a' already appeared as list item in an 'allocate' directive" } */ } template void multiple_uses_dep_directive_before_invalid_align<42>(); @@ -1032,11 +1032,6 @@ void multiple_uses_dep_directive_after_invalid_align() int a; #pragma omp allocate(a) /* { dg-note "'a' previously appeared here" } */ #pragma omp allocate(a) align(Align) /* { dg-error "'a' already appeared as list item in an 'allocate' directive" } */ - /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { xfail *-*-* } .-1 } */ + /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { target *-*-* } .-1 } */ } template void multiple_uses_dep_directive_after_invalid_align<42>(); - -/* These are fixed by the later location wrapping patch. */ -/* { dg-bogus "'align' clause argument needs to be positive constant power of two integer expression" "" { xfail *-*-* } 0 } */ -/* { dg-bogus "'allocator' clause requires a constant predefined allocator" "" { xfail *-*-* } 0 } */ -/* { dg-bogus "expression evaluates to '1024'" "" { xfail *-*-* } 0 } */ diff --git a/gcc/testsuite/g++.dg/gomp/allocate-17.C b/gcc/testsuite/g++.dg/gomp/allocate-17.C index e265ecdd1e7..93777d611ea 100644 --- a/gcc/testsuite/g++.dg/gomp/allocate-17.C +++ b/gcc/testsuite/g++.dg/gomp/allocate-17.C @@ -31,7 +31,7 @@ auto lambda_0_bad_align() int b = 42; decltype(p3) a = b; #pragma omp allocate(a) align(Align) allocator(p2) - /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { xfail *-*-* } .-1 } */ + /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { target *-*-* } .-1 } */ return a; }; }; @@ -87,7 +87,7 @@ auto lambda_0_all() decltype(p3) a = b; /* { dg-message "'a' declared here" } */ #pragma omp allocate(a) align(Align) allocator(p2) /* { dg-error "variables with reference type may not appear in an 'allocate' directive" "" { target *-*-* } .-1 } */ - /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { xfail *-*-* } .-2 } */ + /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { target *-*-* } .-2 } */ /* { dg-error "invalid conversion from 'int' to 'omp_allocator_handle_t'" "" { target *-*-* } .-3 } */ return a; }; @@ -212,18 +212,18 @@ auto lambda_1_bad_align() { return [](auto p0){ int a = 42; - #pragma omp allocate(a) align(Align) /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { xfail *-*-* } } */ + #pragma omp allocate(a) align(Align) /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" } */ return [](auto p1){ int a = 42; - #pragma omp allocate(a) align(Align) /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { xfail *-*-* } } */ + #pragma omp allocate(a) align(Align) /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" } */ return [](auto p2){ int a = 42; - #pragma omp allocate(a) align(Align) /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { xfail *-*-* } } */ + #pragma omp allocate(a) align(Align) /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" } */ return [p2](auto p3){ int b = 42; decltype(p3) a = b; #pragma omp allocate(a) align(Align) allocator(p2) - /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { xfail *-*-* } .-1 } */ + /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { target *-*-* } .-1 } */ return a; }; }; @@ -284,19 +284,19 @@ auto lambda_1_all() { return [](auto p0){ int a = 42; - #pragma omp allocate(a) align(Align) /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { xfail *-*-* } } */ + #pragma omp allocate(a) align(Align) /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" } */ return [](auto p1){ int a = 42; - #pragma omp allocate(a) align(Align) /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { xfail *-*-* } } */ + #pragma omp allocate(a) align(Align) /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" } */ return [](auto p2){ int a = 42; - #pragma omp allocate(a) align(Align) /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { xfail *-*-* } } */ + #pragma omp allocate(a) align(Align) /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" } */ return [p2](auto p3){ int b = 42; decltype(p3) a = b; /* { dg-message "'a' declared here" } */ #pragma omp allocate(a) align(Align) allocator(p2) /* { dg-error "variables with reference type may not appear in an 'allocate' directive" "" { target *-*-* } .-1 } */ - /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { xfail *-*-* } .-2 } */ + /* { dg-error "'align' clause argument needs to be positive constant power of two integer expression" "" { target *-*-* } .-2 } */ /* { dg-error "invalid conversion from 'int' to 'omp_allocator_handle_t'" "" { target *-*-* } .-3 } */ return a; }; @@ -555,6 +555,3 @@ void instantiate_lambdas_2() auto c3 = c2.operator()(a); /* { dg-message "required from here" } */ } } - -/* This is fixed by the later location wrapping patch. */ -/* { dg-bogus "'align' clause argument needs to be positive constant power of two integer expression" "" { xfail *-*-* } 0 } */