1

I'm having a strange error (Semantic Error) in Eclipse Oxygen C++ with MINGWcompiler.

when I try to use an unique_ptr, eclipse issues an error:

Method 'method_name()' could not be resolved --> Semantic Error.

Example proposal:

#include <iostream>
#include <memory>
#include <string>
using namespace std;

struct Demo {
    Demo(): a(1) {}
    void doSomething() {cout << a << endl}
    int a;
};

int main() {           
    unique_ptr<Demo> demo = make_unique<Demo>();
    demo->doSomething(); //
    return 0;
}

Some fail images:

Eclipse fail _ img

Eclipse fail _ img2

It compiles and work, but the problem never dissappear, any idea to fix it? Is not a problem due to c++14 and make_unique, beacause using a raw pointer it works as well and the problem also persists.

int main() {           
        unique_ptr<Demo> demo (new Demo);
        demo->doSomething(); //
        return 0;
}

Thanks in advance.

Mzdp
  • 43
  • 1
  • 5
  • Is not a duplicate, builds and works, is an indexer problem. – Mzdp Dec 18 '17 at 11:51
  • That thread discusses issues with indexer as well. – user7860670 Dec 18 '17 at 11:53
  • Too easy to say is the same question, when is not the same. If you think you will get stack points by those comment..... The problem is not about recognise unique_ptr word and also it compiles and work – Mzdp Dec 19 '17 at 12:49

0 Answers0