This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/78388] Bogus "declaration shadows template parameter" error with parenthesized function-style casts
- From: "egallager at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 23 Aug 2017 14:09:25 +0000
- Subject: [Bug c++/78388] Bogus "declaration shadows template parameter" error with parenthesized function-style casts
- Auto-submitted: auto-generated
- References: <bug-78388-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78388
Eric Gallager <egallager at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
Status|UNCONFIRMED |NEW
Last reconfirmed| |2017-08-23
CC| |egallager at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #1 from Eric Gallager <egallager at gcc dot gnu.org> ---
Confirmed that gcc errors and clang doesn't:
$ /usr/local/bin/g++ -c -Wall -Wextra -pedantic -Wshadow 78388.cc
78388.cc: In function ‘void f()’:
78388.cc:4:17: error: declaration of ‘void i’ shadows template parameter
(int((void(i), 1))) + 0;
^
78388.cc:1:10: note: template parameter ‘i’ declared here
template<int i>
^~~
$ /sw/opt/llvm-3.1/bin/clang++ -c -Wall -Wextra -pedantic -Wshadow 78388.cc
78388.cc:4:25: warning: expression result unused [-Wunused-value]
(int((void(i), 1))) + 0;
~~~~~~~~~~~~~~~~~~~ ^ ~
1 warning generated.
$
Function-style casts are evil, see bug 69818 (which is asking for a warning in
a different context, but still)