[Bug c++/78388] Bogus "declaration shadows template parameter" error with parenthesized function-style casts

2019-05-22 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78388

Eric Gallager  changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org,
   ||nathan at gcc dot gnu.org

--- Comment #2 from Eric Gallager  ---
cc-ing C++ FE maintainers

[Bug c++/78388] Bogus "declaration shadows template parameter" error with parenthesized function-style casts

2017-08-23 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78388

Eric Gallager  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  ---
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
  ^~~
$ /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)