public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/84469] structured binding inside for all loop thinks it is type depedent when it is not (inside a template) Date: Mon, 28 Nov 2022 08:54:34 +0000 [thread overview] Message-ID: <bug-84469-4-BIONOVSAKC@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-84469-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84469 --- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> --- The patch unfortunately regresses the OpenMP g++.dg/gomp/for-21.C test: template <int N> void f6 (S (&a)[10]) { #pragma omp for collapse (2) for (auto [i, j, k] : a) // { dg-error "use of 'i' before deduction of 'auto'" "" { target *-*-* } .-1 } for (int l = i; l < j; l += k) // { dg-error "use of 'j' before deduction of 'auto'" } ; // { dg-error "use of 'k' before deduction of 'auto'" "" { target *-*-* } .-3 } } ... S c[10] {}; f6 <0> (c); where the bug is no longer diagnosed. When not in a template or when the range for decl is type dependent, it works because the invalid uses are diagnosed by finish_id_expression -> mark_used and complain about uses of auto before it is deduced, but in the above case a is not type dependent, mark_used doesn't complain about uses of auto when processing_template_decl and the new code deduces a and i/j/k before finish_id_expression is called on it again during instantiation. So, I'll need to add further code to handle this right.
next prev parent reply other threads:[~2022-11-28 8:54 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-84469-4@http.gcc.gnu.org/bugzilla/> 2021-07-22 20:52 ` [Bug c++/84469] GCC rejects valid code in structured binding in range-based-for in template pinskia at gcc dot gnu.org 2021-10-05 5:43 ` pinskia at gcc dot gnu.org 2022-11-24 15:14 ` [Bug c++/84469] structured binding inside for all loop thinks it is type depedent when it is not (inside a template) pinskia at gcc dot gnu.org 2022-11-25 15:16 ` jakub at gcc dot gnu.org 2022-11-28 8:54 ` jakub at gcc dot gnu.org [this message] 2022-12-02 9:34 ` cvs-commit at gcc dot gnu.org 2022-12-02 9:34 ` cvs-commit at gcc dot gnu.org 2022-12-02 10:21 ` jakub at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-84469-4-BIONOVSAKC@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).