
This patch fixes the implementation as well as the tests that didn't actually test the wanted behaviour. You'll find all the details in the bug report. It adds as well deprecation warning for reserve() (without argument) and adds a test. http://wg21.link/P0966R1 https://bugs.llvm.org/show_bug.cgi?id=45368 https://reviews.llvm.org/D54992 Reviewed By: ldionne, #libc Differential Revision: https://reviews.llvm.org/D91778
23 lines
613 B
C++
23 lines
613 B
C++
//===----------------------------------------------------------------------===//
|
|
//
|
|
// 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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// <string>
|
|
|
|
// void reserve(); // Deprecated in C++20
|
|
|
|
// UNSUPPORTED: c++03, c++11, c++14, c++17
|
|
|
|
#include <string>
|
|
|
|
int main(int, char**)
|
|
{
|
|
std::string s;
|
|
s.reserve(); // expected-warning {{'reserve' is deprecated}}
|
|
return 0;
|
|
}
|