repo.or.cz
/
gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Fortran: Fix PR 47485.
[gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
warn
/
Wnonnull12.C
blob
7b2606302f5e221d437c0a2bdd49a39010c0484a
1
/* PR c++/99251 - inconsistent -Wnonnull warning behaviour with dynamic_cast
2
{ dg-do compile }
3
{ dg-options "-Wall" } */
4
5
struct A
6
{
7
virtual ~A ();
8
};
9
10
struct B: A
11
{
12
int f (int);
13
};
14
15
int f1 (A *p)
16
{
17
if (!p)
18
return 0;
19
20
return (dynamic_cast<B *>(p))->f (1);
21
}
22
23
int f2 (A *p)
24
{
25
if (!p)
26
return 0;
27
28
return dynamic_cast<B *>(p)->f (2); // { dg-bogus "\\\[-Wnonnull" }
29
}