mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-26 23:21:11 +00:00
[libc++][print] Includes <format>. (#76333)
The overloads of `println` are specified in terms of `format`. The function `format` is specified to work with ranges. The implementations for `println` do not include `<format>`, but libc++'s granularized header. This means the following example does not work #include <vector> #include <print> int main() { std::vector<int> v{1, 2, 3}; std::println("{}", v); } (The other print functions also require this to work, they are specified in terms of other format functions.) Fixes: https://github.com/llvm/llvm-project/issues/71925
This commit is contained in:
parent
a8b3deb2c8
commit
82d21814e6
@ -175,8 +175,6 @@ void vprint_nonunicode(ostream& os, string_view fmt, format_args args);
|
||||
#include <__availability>
|
||||
#include <__config>
|
||||
#include <__exception/operations.h>
|
||||
#include <__format/format_args.h>
|
||||
#include <__format/format_functions.h>
|
||||
#include <__fwd/ostream.h>
|
||||
#include <__memory/shared_ptr.h>
|
||||
#include <__memory/unique_ptr.h>
|
||||
@ -188,6 +186,7 @@ void vprint_nonunicode(ostream& os, string_view fmt, format_args args);
|
||||
#include <__utility/declval.h>
|
||||
#include <bitset>
|
||||
#include <cstdio>
|
||||
#include <format>
|
||||
#include <ios>
|
||||
#include <locale>
|
||||
#include <new>
|
||||
|
@ -34,17 +34,11 @@ namespace std {
|
||||
#include <__assert> // all public C++ headers provide the assertion handler
|
||||
#include <__concepts/same_as.h>
|
||||
#include <__config>
|
||||
#include <__format/buffer.h>
|
||||
#include <__format/format_arg_store.h>
|
||||
#include <__format/format_args.h>
|
||||
#include <__format/format_context.h>
|
||||
#include <__format/format_error.h>
|
||||
#include <__format/format_functions.h>
|
||||
#include <__format/unicode.h>
|
||||
#include <__system_error/system_error.h>
|
||||
#include <__utility/forward.h>
|
||||
#include <cerrno>
|
||||
#include <cstdio>
|
||||
#include <format>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <version>
|
||||
|
@ -0,0 +1,30 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
|
||||
// UNSUPPORTED: no-filesystem
|
||||
// UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME
|
||||
|
||||
// XFAIL: availability-fp_to_chars-missing
|
||||
|
||||
// <ostream>
|
||||
|
||||
// The Standard does indirectly require that <ostream> includes <format>.
|
||||
// However using the granularized headers so it's possible to implement
|
||||
// <ostream> without <format>. This would be a non-conforming implementation.
|
||||
//
|
||||
// See https://github.com/llvm/llvm-project/issues/71925
|
||||
|
||||
#include <ostream>
|
||||
#include <vector>
|
||||
|
||||
extern std::ostream& os;
|
||||
|
||||
void test() {
|
||||
std::vector<int> v{1, 2, 3};
|
||||
std::print(os, "{} {}", 42, v);
|
||||
}
|
@ -576,45 +576,38 @@ optional typeinfo
|
||||
optional utility
|
||||
optional variant
|
||||
optional version
|
||||
ostream array
|
||||
ostream atomic
|
||||
ostream bitset
|
||||
ostream cmath
|
||||
ostream cerrno
|
||||
ostream concepts
|
||||
ostream cstddef
|
||||
ostream cstdint
|
||||
ostream cstdio
|
||||
ostream cstdlib
|
||||
ostream cstring
|
||||
ostream format
|
||||
ostream initializer_list
|
||||
ostream ios
|
||||
ostream iosfwd
|
||||
ostream iterator
|
||||
ostream limits
|
||||
ostream locale
|
||||
ostream new
|
||||
ostream optional
|
||||
ostream print
|
||||
ostream stdexcept
|
||||
ostream streambuf
|
||||
ostream string
|
||||
ostream string_view
|
||||
ostream tuple
|
||||
ostream type_traits
|
||||
ostream typeinfo
|
||||
ostream version
|
||||
print array
|
||||
print cerrno
|
||||
print cmath
|
||||
print cstddef
|
||||
print cstdint
|
||||
print cstdio
|
||||
print initializer_list
|
||||
print limits
|
||||
print locale
|
||||
print new
|
||||
print optional
|
||||
print format
|
||||
print stdexcept
|
||||
print string
|
||||
print string_view
|
||||
print tuple
|
||||
print version
|
||||
queue compare
|
||||
queue concepts
|
||||
|
|
@ -581,45 +581,38 @@ optional typeinfo
|
||||
optional utility
|
||||
optional variant
|
||||
optional version
|
||||
ostream array
|
||||
ostream atomic
|
||||
ostream bitset
|
||||
ostream cmath
|
||||
ostream cerrno
|
||||
ostream concepts
|
||||
ostream cstddef
|
||||
ostream cstdint
|
||||
ostream cstdio
|
||||
ostream cstdlib
|
||||
ostream cstring
|
||||
ostream format
|
||||
ostream initializer_list
|
||||
ostream ios
|
||||
ostream iosfwd
|
||||
ostream iterator
|
||||
ostream limits
|
||||
ostream locale
|
||||
ostream new
|
||||
ostream optional
|
||||
ostream print
|
||||
ostream stdexcept
|
||||
ostream streambuf
|
||||
ostream string
|
||||
ostream string_view
|
||||
ostream tuple
|
||||
ostream type_traits
|
||||
ostream typeinfo
|
||||
ostream version
|
||||
print array
|
||||
print cerrno
|
||||
print cmath
|
||||
print cstddef
|
||||
print cstdint
|
||||
print cstdio
|
||||
print initializer_list
|
||||
print limits
|
||||
print locale
|
||||
print new
|
||||
print optional
|
||||
print format
|
||||
print stdexcept
|
||||
print string
|
||||
print string_view
|
||||
print tuple
|
||||
print version
|
||||
queue compare
|
||||
queue concepts
|
||||
|
|
@ -583,45 +583,38 @@ optional typeinfo
|
||||
optional utility
|
||||
optional variant
|
||||
optional version
|
||||
ostream array
|
||||
ostream atomic
|
||||
ostream bitset
|
||||
ostream cmath
|
||||
ostream cerrno
|
||||
ostream concepts
|
||||
ostream cstddef
|
||||
ostream cstdint
|
||||
ostream cstdio
|
||||
ostream cstdlib
|
||||
ostream cstring
|
||||
ostream format
|
||||
ostream initializer_list
|
||||
ostream ios
|
||||
ostream iosfwd
|
||||
ostream iterator
|
||||
ostream limits
|
||||
ostream locale
|
||||
ostream new
|
||||
ostream optional
|
||||
ostream print
|
||||
ostream stdexcept
|
||||
ostream streambuf
|
||||
ostream string
|
||||
ostream string_view
|
||||
ostream tuple
|
||||
ostream type_traits
|
||||
ostream typeinfo
|
||||
ostream version
|
||||
print array
|
||||
print cerrno
|
||||
print cmath
|
||||
print cstddef
|
||||
print cstdint
|
||||
print cstdio
|
||||
print initializer_list
|
||||
print limits
|
||||
print locale
|
||||
print new
|
||||
print optional
|
||||
print format
|
||||
print stdexcept
|
||||
print string
|
||||
print string_view
|
||||
print tuple
|
||||
print version
|
||||
queue compare
|
||||
queue concepts
|
||||
|
|
@ -583,45 +583,38 @@ optional typeinfo
|
||||
optional utility
|
||||
optional variant
|
||||
optional version
|
||||
ostream array
|
||||
ostream atomic
|
||||
ostream bitset
|
||||
ostream cmath
|
||||
ostream cerrno
|
||||
ostream concepts
|
||||
ostream cstddef
|
||||
ostream cstdint
|
||||
ostream cstdio
|
||||
ostream cstdlib
|
||||
ostream cstring
|
||||
ostream format
|
||||
ostream initializer_list
|
||||
ostream ios
|
||||
ostream iosfwd
|
||||
ostream iterator
|
||||
ostream limits
|
||||
ostream locale
|
||||
ostream new
|
||||
ostream optional
|
||||
ostream print
|
||||
ostream stdexcept
|
||||
ostream streambuf
|
||||
ostream string
|
||||
ostream string_view
|
||||
ostream tuple
|
||||
ostream type_traits
|
||||
ostream typeinfo
|
||||
ostream version
|
||||
print array
|
||||
print cerrno
|
||||
print cmath
|
||||
print cstddef
|
||||
print cstdint
|
||||
print cstdio
|
||||
print initializer_list
|
||||
print limits
|
||||
print locale
|
||||
print new
|
||||
print optional
|
||||
print format
|
||||
print stdexcept
|
||||
print string
|
||||
print string_view
|
||||
print tuple
|
||||
print version
|
||||
queue compare
|
||||
queue concepts
|
||||
|
|
@ -588,45 +588,38 @@ optional typeinfo
|
||||
optional utility
|
||||
optional variant
|
||||
optional version
|
||||
ostream array
|
||||
ostream atomic
|
||||
ostream bitset
|
||||
ostream cmath
|
||||
ostream cerrno
|
||||
ostream concepts
|
||||
ostream cstddef
|
||||
ostream cstdint
|
||||
ostream cstdio
|
||||
ostream cstdlib
|
||||
ostream cstring
|
||||
ostream format
|
||||
ostream initializer_list
|
||||
ostream ios
|
||||
ostream iosfwd
|
||||
ostream iterator
|
||||
ostream limits
|
||||
ostream locale
|
||||
ostream new
|
||||
ostream optional
|
||||
ostream print
|
||||
ostream stdexcept
|
||||
ostream streambuf
|
||||
ostream string
|
||||
ostream string_view
|
||||
ostream tuple
|
||||
ostream type_traits
|
||||
ostream typeinfo
|
||||
ostream version
|
||||
print array
|
||||
print cerrno
|
||||
print cmath
|
||||
print cstddef
|
||||
print cstdint
|
||||
print cstdio
|
||||
print initializer_list
|
||||
print limits
|
||||
print locale
|
||||
print new
|
||||
print optional
|
||||
print format
|
||||
print stdexcept
|
||||
print string
|
||||
print string_view
|
||||
print tuple
|
||||
print version
|
||||
queue compare
|
||||
queue concepts
|
||||
|
|
@ -398,39 +398,31 @@ optional initializer_list
|
||||
optional limits
|
||||
optional new
|
||||
optional version
|
||||
ostream array
|
||||
ostream bitset
|
||||
ostream cmath
|
||||
ostream cerrno
|
||||
ostream cstddef
|
||||
ostream cstdint
|
||||
ostream cstdio
|
||||
ostream cstring
|
||||
ostream format
|
||||
ostream initializer_list
|
||||
ostream ios
|
||||
ostream limits
|
||||
ostream locale
|
||||
ostream new
|
||||
ostream optional
|
||||
ostream print
|
||||
ostream stdexcept
|
||||
ostream streambuf
|
||||
ostream string
|
||||
ostream string_view
|
||||
ostream tuple
|
||||
ostream typeinfo
|
||||
ostream version
|
||||
print array
|
||||
print cerrno
|
||||
print cmath
|
||||
print cstddef
|
||||
print cstdint
|
||||
print cstdio
|
||||
print initializer_list
|
||||
print limits
|
||||
print locale
|
||||
print new
|
||||
print optional
|
||||
print format
|
||||
print stdexcept
|
||||
print string
|
||||
print string_view
|
||||
print tuple
|
||||
print version
|
||||
queue compare
|
||||
queue cstddef
|
||||
|
|
@ -398,39 +398,31 @@ optional initializer_list
|
||||
optional limits
|
||||
optional new
|
||||
optional version
|
||||
ostream array
|
||||
ostream bitset
|
||||
ostream cmath
|
||||
ostream cerrno
|
||||
ostream cstddef
|
||||
ostream cstdint
|
||||
ostream cstdio
|
||||
ostream cstring
|
||||
ostream format
|
||||
ostream initializer_list
|
||||
ostream ios
|
||||
ostream limits
|
||||
ostream locale
|
||||
ostream new
|
||||
ostream optional
|
||||
ostream print
|
||||
ostream stdexcept
|
||||
ostream streambuf
|
||||
ostream string
|
||||
ostream string_view
|
||||
ostream tuple
|
||||
ostream typeinfo
|
||||
ostream version
|
||||
print array
|
||||
print cerrno
|
||||
print cmath
|
||||
print cstddef
|
||||
print cstdint
|
||||
print cstdio
|
||||
print initializer_list
|
||||
print limits
|
||||
print locale
|
||||
print new
|
||||
print optional
|
||||
print format
|
||||
print stdexcept
|
||||
print string
|
||||
print string_view
|
||||
print tuple
|
||||
print version
|
||||
queue compare
|
||||
queue cstddef
|
||||
|
|
@ -0,0 +1,28 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
// 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
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
|
||||
// UNSUPPORTED: no-filesystem
|
||||
// UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME
|
||||
|
||||
// XFAIL: availability-fp_to_chars-missing
|
||||
|
||||
// <print>
|
||||
|
||||
// The Standard does indirectly require that <print> includes <format>. However
|
||||
// using the granularized headers so it's possible to implement <print> without
|
||||
// <format>. This would be a non-conforming implementation.
|
||||
//
|
||||
// See https://github.com/llvm/llvm-project/issues/71925
|
||||
|
||||
#include <print>
|
||||
#include <vector>
|
||||
|
||||
void test() {
|
||||
std::vector<int> v{1, 2, 3};
|
||||
std::print("{} {}", 42, v);
|
||||
}
|
Loading…
Reference in New Issue
Block a user