| Summary: | Assignment in if statement parsed incorrectly | ||
|---|---|---|---|
| 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, viridia |
| Version: | 8.0.1 | ||
| Target Milestone: | 8.1.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Thanks! Added testcase and fix. *** cdt git genie on behalf of Markus Schorn ***
Bug 362976: Directly nested ambiguity node.
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=0ebca71a1d033d48e706a847f113a4c8c86951de
*** Bug 353265 has been marked as a duplicate of this bug. *** |
An assignment inside an if statement seems to be parsed incorrectly when the right-hand side of the assignment is a call to a template function, and the if statement itself occurs in a template function: template <int> void* foo(int); template <typename T> void f(T t) { if (T* i = foo<0>(0)) // ERROR HERE return 0; } The error on the indicated line is: "Symbol 'i' could not be resolved" The code compiles just fine with GCC.