Skip to main content

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

Please file a bug for this. Thanks.


On Thu, Aug 12, 2010 at 11:41 AM, Tim Black <timblaktu@xxxxxxxxx> wrote:
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 {
        vector<int> m_v;
        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.

cdt-dev mailing list

Back to the top