Bug 571888 - Symbol could not be resolved although it should
Summary: Symbol could not be resolved although it should
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-editor (show other bugs)
Version: 10.1.0   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-11 10:53 EST by mo st CLA
Modified: 2021-03-11 10:56 EST (History)
2 users (show)

See Also:


Attachments
Content is described in the text (39.79 KB, application/x-zip-compressed)
2021-03-11 10:53 EST, mo st CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description mo st CLA 2021-03-11 10:53:19 EST
Created attachment 285805 [details]
Content is described in the text

Hello,

this bug is driving me crazy because I can't imagine where it came from, nor that anyone else has it but me. So I have attached my entire eclipse configuration and the formatter settings as well as the source code and a screenshot.
Anyway, the editor shows me the error that it can't find the symbol my_a in line 24. In line 20 it finds it. I actually have this error in a real project and it is terrible, especially since g++ can compile the project of course because the program is obviously correct.

Best regards

  1 class A {
  2 public:
  3     A();
  4     A(int _i);
  5     int i;
  6 };
  7
  8 class B {
  9 public:
 10     B(int _i);
 11       B(const A&);
 12     A my_a;
 13 };
 14
 15 A::A(int _i)
 16     : i { _i } {
 17 }
 18
 19 B::B(int _i)
 20     : my_a { _i } {
 21 }
 22
 23 B::B(const A &a)
 24     : my_a { a } {
 25 }
 26
 27 int main() {
 28     B(5);
 29 }
 30