tdf#161853 vcl: Drop unnecessary indirection for icon choice control
[libreoffice.git] / o3tl / qa / compile-unsafe_downcast.cxx
blob8471fc250e88c122e9c111eb78f95e440eb62ad0
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include <sal/config.h>
12 #include <o3tl/unsafe_downcast.hxx> // expected-note@o3tl/unsafe_downcast.hxx:* 0+ {{}}
14 struct Base
16 virtual ~Base();
19 struct Derived : Base
23 void f(Base* b, Derived* d)
25 o3tl::unsafe_downcast<Derived*>(b);
26 o3tl::unsafe_downcast<Derived const*>(b);
27 o3tl::unsafe_downcast<Derived&>(*b); // expected-error {{}}
28 o3tl::unsafe_downcast<Derived*>(d);
29 o3tl::unsafe_downcast<Base*>(d); // expected-error {{}}
32 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */