http://llvm.org/bugs/show_bug.cgi?id=20591
Bug ID: 20591
Summary: No diagnostic when a template parameter has the same
name as the template name
Product: clang
Version: 3.4
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
The following code compiles without any error:
template <int what>
void what(int) {}
int main() {}
It's not well-formed according to § 14.6.1.6:
"A template-parameter shall not be redeclared within its scope (including
nested scopes). _A template-parameter shall not have the same name as the
template name._"
g++ 4.7.2 provides the following diagnostic:
program.cpp:2:6: error: declaration of ‘template<int what> void what(int)’
program.cpp:1:11: error: shadows template parm ‘int what’
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs