Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/warn/Wnonnull-compare-8.C @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // PR c++/70295 |
2 // { dg-do compile } | |
3 // { dg-options "-O2 -Wnonnull-compare" } | |
4 | |
5 struct A { A (); virtual ~A (); bool foo (bool); }; | |
6 struct B : virtual public A { B (); virtual ~B (); }; | |
7 | |
8 bool | |
9 A::foo (bool x) | |
10 { | |
11 if (x && dynamic_cast<B *>(this) != (B *) 0) // { dg-bogus "nonnull argument" } | |
12 return true; | |
13 return false; | |
14 } |