| Summary: | "Invalid redefinition" error for functions with identical signatures but different template parameters | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Nathan Ridge <zeratul976> | ||||
| Component: | cdt-parser | Assignee: | Markus Schorn <mschorn.eclipse> | ||||
| Status: | RESOLVED FIXED | QA Contact: | Markus Schorn <mschorn.eclipse> | ||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | cdtdoug | ||||
| Version: | 8.0 | ||||||
| Target Milestone: | 8.0 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
For the following code: #include <iostream> using namespace std; template <typename T> void g() { cout << "one\n"; } template <typename T, typename U> void g() // ERROR HERE { cout << "two\n"; } int main() { g<int>(); g<int, int>(); return 0; } The parser gives the error: "Invalid redefinition of g". The code compiles fine with gcc and produces the output one two as expected.