4

I'm using eclipse CDT 8.1.1

The issue is that, when using C++11 class member initializers, it complains that the members are not initialized. It's still expecting an initializer list.

class Foo {
public:
  Foo() {} // warning: Member `m_bar` was not initialized in this constructor
 private:
  int m_bar = 0;
};

Is there anything I can do about this?

Ilia Choly
  • 18,070
  • 14
  • 92
  • 160
  • And it accepts the syntax, but just gives the warning? – chris Nov 16 '12 at 14:40
  • yes. It's not a huge issue, it just makes all of those warnings (even the real ones) useless because I can't tell the difference. – Ilia Choly Nov 16 '12 at 14:42
  • 3
    Oh, right. If I understand, it's the IDE not being updates for C++11, but the compiler is. If that's the case, it's like the new CTP release for VS and the best you can hope for is to compile it and get actual warnings from the compiler. – chris Nov 16 '12 at 14:43
  • That's too bad. I was kind of expecting that answer though :/ – Ilia Choly Nov 16 '12 at 14:45
  • How about ignore this warning? Something like #pragma warning(...) – ForEveR Nov 16 '12 at 14:49
  • Have you followed the steps outlined [here](http://stackoverflow.com/questions/9131763/eclipse-cdt-c11-c0x-support)? – juanchopanza Nov 16 '12 at 14:50
  • See this section from the [Eclipse CDT FAQ](http://wiki.eclipse.org/CDT/User/FAQ#CDT_does_not_recognize_C.2B.2B11_features). – Olaf Dietsche Nov 16 '12 at 15:29
  • 1
    Eclipse Juno doesn't support this syntax yet. The bug tracker has a bug for all C++11 features in gcc4.7 (which covers N2756, this feature) is here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=363234 – Matt Godbolt Jan 24 '13 at 00:02

0 Answers0