Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] indexer problem - "return has value, in function returning void"

I have some void functions that return the value from other void functions, and the indexer erroneously reports "return has value, in function returning void" in some cases. The compiler of course is fine with this, so when I compile, the Problem window clears. But when the indexer runs again, they come back. This problem seems to happen only when the inner void function is defined in another file.

So, these defs in a .h cause the error:

#include <vector>
using std::vector;
    template <class T>
    class MyVector {
      private:
        vector<int> m_v;
      public:
        MyVector() : m_v() {}
        void push_back(T t) { return m_v.push_back(t); }  // "Return has value, in function returning void"
    };

But this in a .h does not:

    template <class T>
    class MyClass {
        void foo() { return goo(); }
        void goo() {}
    };

And this in a .cpp does not:

void goo() { }
void foo() {
  return goo();
}

I searched bugzilla and couldn't find any corresponding issue.

Back to the top