OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.jason/] [dot.C] - Rev 149

Go to most recent revision | Compare with Previous | Blame | View Log

// { dg-do assemble  }
// PRMS Id: 4143
// Bug: Pointer is silently dereferenced in method call.

extern "C" int printf (const char *, ...);

class Test
{
    char ch;
  public:
    Test(char c) : ch(c) {}
    void Print() { printf("%c", ch); }
};

int main()
{
    Test *p = new Test('x');

    p.Print();  // { dg-error "" } 
}

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.