diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2024-10-01 13:31:00 +0200 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2024-10-01 10:45:54 -0400 |
commit | 1b7cfa715c6c02db6ef587c87757d7792fc43423 (patch) | |
tree | e342ae3ac5d545f33373ead90e6bb80961672d74 /libgcc/config/h8300 | |
parent | 698e0ec89bc0960e074d2222208bffe47f5addd9 (diff) | |
download | gcc-1b7cfa715c6c02db6ef587c87757d7792fc43423.zip gcc-1b7cfa715c6c02db6ef587c87757d7792fc43423.tar.gz gcc-1b7cfa715c6c02db6ef587c87757d7792fc43423.tar.bz2 |
c++: introduce __builtin_is_virtual_base_of
P2985R0 (C++26) introduces std::is_virtual_base_of; this is the compiler
builtin that will back up the library trait (which strictly requires
compiler support).
The name has been chosen to match LLVM/MSVC's, as per the discussion
here:
https://github.com/llvm/llvm-project/issues/98310
The actual user-facing type trait in libstdc++ will be added later.
gcc/cp/ChangeLog:
* constraint.cc (diagnose_trait_expr): New diagnostic.
* cp-trait.def (IS_VIRTUAL_BASE_OF): New builtin.
* cp-tree.h (enum base_access_flags): Add a new flag to be
able to request a search for a virtual base class.
* cxx-pretty-print.cc (pp_cxx_userdef_literal): Update the
list of GNU extensions to the grammar.
* search.cc (struct lookup_base_data_s): Add a field to
request searching for a virtual base class.
(dfs_lookup_base): Add the ability to look for a virtual
base class.
(lookup_base): Forward the flag to dfs_lookup_base.
* semantics.cc (trait_expr_value): Implement the builtin
by calling lookup_base with the new flag.
(finish_trait_expr): Handle the new builtin.
gcc/ChangeLog:
* doc/extend.texi: Document the new
__builtin_is_virtual_base_of builtin; amend the docs for
__is_base_of.
gcc/testsuite/ChangeLog:
* g++.dg/ext/is_virtual_base_of.C: New test.
* g++.dg/ext/is_virtual_base_of_diagnostic.C: New test.
Signed-off-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
Diffstat (limited to 'libgcc/config/h8300')
0 files changed, 0 insertions, 0 deletions