This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Additional features for -fms-extensions



On Oct 30, 2004, at 12:39 PM, Schönbeck, Andreas wrote:


/*
  Results:

GCC:
test2.cxx: In function 'int main()':
test2.cxx:xx: warning: cannot pass objects of non-POD type 'Class Point'
through '...'; call will abort at runtime
*/


void test(...)
{
}

class Point
{
public:
  Point(int x, int y) { this->x = x; this->y = y; }
  int getX() { return x; }
  int getY() { return y; }

private:
  int x;
  int y;
};

int main()
{
  Point p(1,1);

test(p);

  return 0;
}

The reason why this is a warning and will abort at runtime is because it
is undefined by the C++ standard and the ABI cannot handle when the deconstructor is called.


-- Pinski


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]