gcc/testsuite/g++.old-deja/g++.law/typeck1.C
raw| 1 | // { dg-do assemble } |
| 2 | // GROUPS passed typeck |
| 3 | // typeck file |
| 4 | // From: [email protected] (Vern Paxson) |
| 5 | // Date: 24 Sep 1992 23:11:22 GMT |
| 6 | // Subject: 2.2.2 type-checking error (?) when comparing pointers |
| 7 | // Message-ID: <[email protected]> |
| 8 | |
| 9 | |
| 10 | class a { }; |
| 11 | class foo : a { }; |
| 12 | class bar : a { }; |
| 13 | |
| 14 | int test( const foo* f, const bar* b ) |
| 15 | { |
| 16 | return f == b;// { dg-error "26:comparison between distinct pointer types" } |
| 17 | } |
| 18 |