| Summary: | erroneous warning of "invalid arguments" for method arguments of type std::vector<bool>::reference / std::_Bit_reference | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Gero Bugs <gero> |
| Component: | cdt-codan | Assignee: | CDT Codan Inbox <cdt-codan-inbox> |
| Status: | RESOLVED WORKSFORME | QA Contact: | Elena Laskavaia <elaskavaia.cdt> |
| Severity: | normal | ||
| Priority: | P3 | CC: | cdtdoug, yevshif, zeratul976 |
| Version: | 8.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| See Also: |
https://bugs.eclipse.org/bugs/show_bug.cgi?id=349849 https://bugs.eclipse.org/bugs/show_bug.cgi?id=357304 |
||
| Whiteboard: | |||
BTW, casting (redundantly) bitVector[0] to std::_Bit_reference makes the error go away. I guess that suggests that CDT is not resolving the type of bitVector[0] correctly? Another problem that could be related: On an std::vector<bool> object, code completion correctly proposes methods such as push_back(...) or at(...) but then the editor marks them with a wiggly line, again with the "Invalid arguments" comment when the arguments really are correct. Bug #349849 and #357304 also report similar problems. Maybe this is something bigger? Alas, even the oldest of these bugs is still unassigned half a year after filing. Works fine for me with CDT 8.2 (Kepler). |
Build Identifier: Version: Indigo Service Release 1 Build id: 20110916-0149 The following code compiles with no problem but CDT shows an error: class X { void bitReferenceMethod( std::vector<bool>::reference reference ) {} void methodCaller() { std::vector<bool> bitVector; bitReferenceMethod( bitVector[0] ); } }; There is a wiggly line under 'bitReferenceMethod' with the message: "Invalid arguments ' Candidates are: void bitReferenceMethod(std::_Bit_reference)" --but bitVector[0] does resolve to type std::_Bit_reference! (And what is that single quote doing in the error message?) Reproducible: Always Steps to Reproduce: Just copy the class definition above into the CDT editor.