2017-11-15 20:02:27 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
//
|
2019-01-19 10:56:40 +00:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2017-11-15 20:02:27 +00:00
|
|
|
//
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
|
|
// <string>
|
|
|
|
|
|
|
|
|
|
// class deque
|
|
|
|
|
|
[libc++] Implement P0980R1 (constexpr std::string)
Reviewed By: #libc, ldionne
Spies: daltenty, sdasgup3, ldionne, arichardson, MTC, ChuanqiXu, mehdi_amini, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, stephenneuendorffer, Joonsoo, grosul1, Kayjukh, jurahul, msifontes, tatianashp, rdzhabarov, teijeong, cota, dcaballe, Chia-hungDuan, wrengr, wenzhicui, arphaman, Mordante, miscco, Quuxplusone, smeenai, libcxx-commits
Differential Revision: https://reviews.llvm.org/D110598
2022-04-27 10:11:44 +02:00
|
|
|
// bool empty() const noexcept; // constexpr since C++20
|
2017-11-15 20:02:27 +00:00
|
|
|
|
2020-06-01 10:38:23 -04:00
|
|
|
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
2017-11-15 20:02:27 +00:00
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
2023-03-16 12:45:41 -04:00
|
|
|
void f() {
|
2022-02-07 21:54:49 +01:00
|
|
|
std::string c;
|
|
|
|
|
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
2017-11-15 20:02:27 +00:00
|
|
|
}
|