Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 367560 - False positive error when unpacking a variadic parameter pack
Summary: False positive error when unpacking a variadic parameter pack
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 8.1.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 8.1.0   Edit
Assignee: Markus Schorn CLA
QA Contact: Markus Schorn CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-26 16:58 EST by Nathan Ridge CLA
Modified: 2012-02-23 11:33 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.