[Bug c++/124197] template-for vs -Wshadow

matt at godbolt dot org via Gcc-bugs <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124197

Matt Godbolt <matt at godbolt dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |matt at godbolt dot org

--- Comment #2 from Matt Godbolt <matt at godbolt dot org> ---
Another simple repro: https://compiler-explorer.com/z/veaM7rGzz

```
#include <array>

constexpr std::array<int, 3> values{1, 2, 3};
void test() {
    int sum = 0;
    template for (constexpr auto value : values) {
        sum += value;
    }  // 3 spurious warnings
}
```
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.