Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 367560

Summary: False positive error when unpacking a variadic parameter pack
Product: [Tools] CDT Reporter: Nathan Ridge <zeratul976>
Component: cdt-parserAssignee: Markus Schorn <mschorn.eclipse>
Status: RESOLVED FIXED QA Contact: Markus Schorn <mschorn.eclipse>
Severity: normal    
Priority: P3 CC: cdtdoug
Version: 8.1.0   
Target Milestone: 8.1.0   
Hardware: All   
OS: All   
Whiteboard:

Description Nathan Ridge CLA 2011-12-26 16:58:46 EST
In the following code:

template <typename... Args>
void foo(int, int, Args...);

template <typename... Args>
void bar(Args... args)
{
    foo(args...);  // ERROR HERE: "Invalid arguments: Candidates are: void foo(int, int, #0 ...)"
}

It is wrong to treat the call as an error in general, because it could be that bar() is only ever called with parameters such that the first two are convertible to 'int'.
Comment 1 Markus Schorn CLA 2012-01-02 09:07:04 EST
Good catch!
Added testcase and fix.