Logo Search packages:      
Sourcecode: gcc-2.95 version File versions

bug-43170.cc

// The following code gives a parse error with BUG defined. Looking at the
// info docs, I don't think it should.
//
// Exact error messages:
//
// [downstairs:~] $ g++ -c test.cc
// [downstairs:~] $ g++ -DBUG -c test.cc
// test.cc:13: function body for constructor missing
// test.cc:13: parse error before `{'
// test.cc: In method `class string foo::do_foo(const string &)':
// test.cc:13: parse error before `;'
// test.cc:13: parse error at end of saved function text

#include <function.h>
#include <string>

string do_foo(const string& a) return ret;
{
  ret = "foo" + a;
}

struct foo
{
  string do_foo2(const string& a);
#ifdef BUG
  string do_foo(const string& a) return ret; {
    ret = "foo" + a;
  }
#endif
};

string foo::do_foo2(const string& a) return ret; {
      ret = "foo" + a;
}

Generated by  Doxygen 1.6.0   Back to index