From 649313625b94e6b879848fc19b607b74375100bf Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 17 May 2018 11:28:56 +0200 Subject: New o3tl::temporary to simplify calls of std::modf ...that ignore the out-parameter integral part Change-Id: I05f07c1a8909023232f8aecf75ea5541d4eb81ca Reviewed-on: https://gerrit.libreoffice.org/54474 Reviewed-by: Stephan Bergmann Tested-by: Stephan Bergmann --- o3tl/qa/compile-temporary.cxx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 o3tl/qa/compile-temporary.cxx (limited to 'o3tl/qa') diff --git a/o3tl/qa/compile-temporary.cxx b/o3tl/qa/compile-temporary.cxx new file mode 100644 index 000000000000..1d8d84bd5fb5 --- /dev/null +++ b/o3tl/qa/compile-temporary.cxx @@ -0,0 +1,25 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include + +#include + +void f(int*); + +int g(); + +void h(int n) +{ + f(&o3tl::temporary(int())); + f(&o3tl::temporary(g())); + f(&o3tl::temporary(n)); // expected-error {{}} expected-note@o3tl/temporary.hxx:* 0+ {{}} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ -- cgit