Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 368606 - erroneous warning of "invalid arguments" for method arguments of type std::vector<bool>::reference / std::_Bit_reference
Summary: erroneous warning of "invalid arguments" for method arguments of type std::ve...
Status: RESOLVED WORKSFORME
Alias: None
Product: CDT
Classification: Tools
Component: cdt-codan (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: CDT Codan Inbox CLA
QA Contact: Elena Laskavaia CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-14 14:38 EST by Gero Bugs CLA
Modified: 2016-12-29 18:28 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gero Bugs CLA 2012-01-14 14:38:31 EST
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.
Comment 1 Gero Bugs CLA 2012-01-14 14:52:38 EST
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?
Comment 2 Gero Bugs CLA 2012-01-16 05:50:15 EST
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.
Comment 3 Nathan Ridge CLA 2013-07-17 21:55:57 EDT
Works fine for me with CDT 8.2 (Kepler).
Comment 4 Nathan Ridge CLA 2016-12-29 18:28:06 EST
Closing per comment 3. Feel free to reopen if you're still seeing this.