As the comment in the following code snippet says, this is a workaround for a gcc 4.4. bug, which I probably should remove now. See Template template parameters and variadic templates with gcc 4.4 for the background to this.
In any case, this gives an error on Debian Wheezy with clang 3.4.2-4, backported from unstable. This works fine with gcc 4.9 also backported from unstable (and 4.7) on Debian Wheezy.
// Workaround for gcc 4.4 bug. See https://stackoverflow.com/q/8514633/350713
template <typename S, typename T,
template <typename S, typename T, typename... Args> class C,
typename... Args>
struct maptype
{
typedef C<S, T, Args...> type;
};
int main(void){}
The error is
clang++ -o shadow.ocl -c -ftemplate-depth-100 -fno-strict-aliasing -fno-common -ansi -Wextra -Wall -Werror -Wno-unused-function -Wc++0x-compat -Wpointer-arith -Wcast-qual -Wcast-align -std=c++11 -mtune=native -msse3 -O3 shadow.cc
shadow.cc:3:23: error: declaration of 'S' shadows template parameter
template <typename S, typename T, typename... Args> class C,
^
shadow.cc:2:20: note: template parameter is declared here
template <typename S, typename T,
^
shadow.cc:3:35: error: declaration of 'T' shadows template parameter
template <typename S, typename T, typename... Args> class C,
^
shadow.cc:2:32: note: template parameter is declared here
template <typename S, typename T,
^
2 errors generated.
I see at least a couple of superficially similar questions on SO, i.e. Clang VS VC++:"error: declaration of 'T' shadows template parameter" and C++ template that used to work in old gcc results in 'shadows template parameter' error in clang++ but is is not obvious to me whether they are a different problem or the same problem.
Clarifications appreciated. I don't write C++ regularly, and it has been a while since I looked at template template parameters.