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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.jason/] [dot.C] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// { dg-do assemble  }
2
// PRMS Id: 4143
3
// Bug: Pointer is silently dereferenced in method call.
4
 
5
extern "C" int printf (const char *, ...);
6
 
7
class Test
8
{
9
    char ch;
10
  public:
11
    Test(char c) : ch(c) {}
12
    void Print() { printf("%c", ch); }
13
};
14
 
15
int main()
16
{
17
    Test *p = new Test('x');
18
 
19
    p.Print();  // { dg-error "" }
20
}

powered by: WebSVN 2.1.0

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