Commit Graph

193085 Commits

Author SHA1 Message Date
Jonathan Wakely 50712db568 libstdc++: Fix printing of std::atomic<shared_ptr<T>> for versioned namespace
libstdc++-v3/ChangeLog:

	* python/libstdcxx/v6/printers.py (SharedPointerPrinter): Strip
	versioned namespace from the template argument too.

(cherry picked from commit 634b0089f6)
2022-05-27 18:32:52 +01:00
Jonathan Wakely 7be1dd924d libstdc++: Add constexpr to std::counted_iterator post-increment (LWG 3643)
libstdc++-v3/ChangeLog:

	* include/bits/stl_iterator.h (counted_iterator::operator++(int)):
	Add 'constexpr' as per LWG 3643.
	* testsuite/24_iterators/counted_iterator/lwg3643.cc: New test.

(cherry picked from commit 47b20d027a)
2022-05-27 18:32:52 +01:00
Jonathan Wakely 5647e401bb libstdc++: Implement LWG 3683 for pmr::polymorphic_allocator
This issue has recently been moved to Tentatively Ready, and seems
uncontroversial. This allows equality comparison with types that are
convertible to pmr::polymorphic_allocator, which fail deduction for the
existing equality operator.

libstdc++-v3/ChangeLog:

	* include/std/memory_resource (polymorphic_allocator): Add
	non-template equality operator, as proposed for LWG 3683.
	* testsuite/20_util/polymorphic_allocator/lwg3683.cc: New test.

(cherry picked from commit f13f9c99db)
2022-05-27 18:32:52 +01:00
Jonathan Wakely 871aa11366 libstdc++: Reduce <random> test iterations for simulators
Some of these tests take several minutes on a simulator like cris-elf,
so we can conditionally run fewer iterations. The testDiscreteDist
helper already supports custom sizes so we just need to make use of that
when { target simulator } matches.

The relevant code is sufficiently tested on other targets, so we're not
losing anything by only running a small number of iterators for sims.

libstdc++-v3/ChangeLog:

	* testsuite/26_numerics/random/bernoulli_distribution/operators/values.cc:
	Run fewer iterations for simulator targets.
	* testsuite/26_numerics/random/binomial_distribution/operators/values.cc:
	Likewise.
	* testsuite/26_numerics/random/discrete_distribution/operators/values.cc:
	Likewise.
	* testsuite/26_numerics/random/geometric_distribution/operators/values.cc:
	Likewise.
	* testsuite/26_numerics/random/negative_binomial_distribution/operators/values.cc:
	Likewise.
	* testsuite/26_numerics/random/poisson_distribution/operators/values.cc:
	Likewise.
	* testsuite/26_numerics/random/uniform_int_distribution/operators/values.cc:
	Likewise.

(cherry picked from commit e3b8b4f781)
2022-05-27 18:32:51 +01:00
Jonathan Wakely bcb39ac643 libstdc++: Skip tests that fail for the versioned namespace
Most tests for the contents of header synopses need to be supressed for
the versioned namespace build, because redeclaring the entities in std
fails when they were originally declared in std::__8.

I added these tests recently without the suppression, so they fail.

libstdc++-v3/ChangeLog:

	* testsuite/20_util/expected/synopsis.cc: Skip for versioned
	namespace.
	* testsuite/27_io/headers/iosfwd/synopsis.cc: Likewise.

(cherry picked from commit 1815462a6e)
2022-05-27 18:32:51 +01:00
Jonathan Wakely 702ac6e761 libstdc++: Fix typo in doxygen @headerfile command
libstdc++-v3/ChangeLog:

	* include/bits/mofunc_impl.h: Fix doxygen command.

(cherry picked from commit 4163b0be81)
2022-05-27 18:32:51 +01:00
Jonathan Wakely d2b9fdedcd libstdc++: Add noexcept to std::launch operators
libstdc++-v3/ChangeLog:

	* include/std/future (launch): Make operators noexcept.

(cherry picked from commit 8659bcd6b7)
2022-05-27 18:32:51 +01:00
Marek Polacek 2c11a9a380 c++: Fix ICE with -Wmismatched-tags [PR105725]
Here we ICE with -Wmismatched-tags on something like

  template <class T>
  bool B<T, enable_if_t<is_class_v<class T::foo>>>;

Specifically, the "class T::foo" bit.  There, class_decl_loc_t::add gets
a TYPENAME_TYPE as TYPE, rather than a class/union type, so checking
TYPE_BEING_DEFINED will crash.  I think it's OK to allow a TYPENAME_TYPE to
slip into that function; we just shouldn't consider the 'class' tag redundant
(which works as a 'typename').  In fact, every other compiler *requires* it.

	PR c++/105725

gcc/cp/ChangeLog:

	* parser.cc (class_decl_loc_t::add): Check CLASS_TYPE_P.

gcc/testsuite/ChangeLog:

	* g++.dg/warn/Wmismatched-tags-10.C: New test.

(cherry picked from commit d822f4bbd7)
2022-05-27 12:07:35 -04:00
GCC Administrator 57fdcaf17d Daily bump. 2022-05-27 00:18:42 +00:00
Simon Cook f1e47f34ab RISC-V: Don't unconditionally add m,a,f,d in arch-canonicalize
This solves an issue where rv32i, etc. are canonicalized to rv32imafd
since the g->i addition of 'm', 'a', 'f', 'd' is not actually gated by
whether the input was rv32g/rv64g.

gcc/ChangeLog:

	* config/riscv/arch-canonicalize: Only add mafd extension if
	base was rv32/rv64g.

(cherry picked from commit 63f198553d)
2022-05-26 14:09:58 +08:00
Kito Cheng 02e8dea494 RISC-V: Fix wrong expansion for arch-canonicalize
rv64gcv should exapnd into:

rv64imafdcv_zicsr_zifencei_zve32f_zve32x_zve64d_zve64f_zve64x_zvl128b_zvl32b_zvl64b

but we exapnd fd twice for now:

rv64imafdfdcv_zicsr_zifencei_zve32f_zve32x_zve64d_zve64f_zve64x_zvl128b_zvl32b_zvl64b

gcc/ChangeLog:

	* config/riscv/arch-canonicalize: Handle g correctly.

(cherry picked from commit 27239e13b1)
2022-05-26 14:09:56 +08:00
GCC Administrator 0320f3b120 Daily bump. 2022-05-26 00:19:12 +00:00
GCC Administrator ed843f1314 Daily bump. 2022-05-25 00:19:20 +00:00
Qing Zhao 79ae75cc25 i386: Adjust -fzero-call-used-regs to always use XOR [PR101891]
Currently on i386, -fzero-call-used-regs uses a pattern of:

XOR regA,regA
MOV regA,regB
MOV regA,regC
...
RET

However, this introduces both a register ordering dependency (e.g. the CPU
cannot clear regB without clearing regA first), and while greatly reduces
available ROP gadgets, it does technically leave a set of "MOV" ROP gadgets
at the end of functions (e.g. "MOV regA,regC; RET").

This patch will switch to always use XOR on i386:

XOR regA,regA
XOR regB,regB
XOR regC,regC
...
RET

gcc/ChangeLog:

	PR target/101891
	* config/i386/i386.cc (zero_call_used_regno_mode): use V2SImode
	as a generic MMX mode instead of V4HImode.
	(zero_all_mm_registers): Use SET to zero instead of MOV for
	zeroing scratch registers.
	(ix86_zero_call_used_regs): Likewise.

gcc/testsuite/ChangeLog:

	* gcc.target/i386/zero-scratch-regs-1.c: Add -fno-stack-protector
	-fno-PIC.
	* gcc.target/i386/zero-scratch-regs-10.c: Adjust mov to xor.
	* gcc.target/i386/zero-scratch-regs-13.c: Add -msse.
	* gcc.target/i386/zero-scratch-regs-14.c: Adjust mov to xor.
	* gcc.target/i386/zero-scratch-regs-15.c: Add -fno-stack-protector
	-fno-PIC.
	* gcc.target/i386/zero-scratch-regs-16.c: Likewise.
	* gcc.target/i386/zero-scratch-regs-17.c: Likewise.
	* gcc.target/i386/zero-scratch-regs-18.c: Add -fno-stack-protector
	-fno-PIC, adjust mov to xor.
	* gcc.target/i386/zero-scratch-regs-19.c: Add -fno-stack-protector
	-fno-PIC.
	* gcc.target/i386/zero-scratch-regs-2.c: Adjust mov to xor.
	* gcc.target/i386/zero-scratch-regs-20.c: Add -msse.
	* gcc.target/i386/zero-scratch-regs-21.c: Add -fno-stack-protector
	-fno-PIC, Adjust mov to xor.
	* gcc.target/i386/zero-scratch-regs-22.c: Adjust mov to xor.
	* gcc.target/i386/zero-scratch-regs-23.c: Likewise.
	* gcc.target/i386/zero-scratch-regs-26.c: Likewise.
	* gcc.target/i386/zero-scratch-regs-27.c: Likewise.
	* gcc.target/i386/zero-scratch-regs-28.c: Likewise.
	* gcc.target/i386/zero-scratch-regs-3.c: Add -fno-stack-protector.
	* gcc.target/i386/zero-scratch-regs-31.c: Adjust mov to xor.
	* gcc.target/i386/zero-scratch-regs-4.c: Add -fno-stack-protector
	-fno-PIC.
	* gcc.target/i386/zero-scratch-regs-5.c: Adjust mov to xor.
	* gcc.target/i386/zero-scratch-regs-6.c: Add -fno-stack-protector.
	* gcc.target/i386/zero-scratch-regs-7.c: Likewise.
	* gcc.target/i386/zero-scratch-regs-8.c: Adjust mov to xor.
	* gcc.target/i386/zero-scratch-regs-9.c: Add -fno-stack-protector.

(cherry picked from commit 0b86943aca)
2022-05-24 15:03:40 +00:00
Bruno Haible 394ff2fbfc Extend --with-zstd documentation
The patch that was so far added for documenting --with-zstd is pretty
minimal:
  - it refers to undocumented options --with-zstd-include and
    --with-zstd-lib;
  - it suggests that --with-zstd can be used without an argument;
  - it does not clarify how this option applies to cross-compilation.

How about adding the same details as for the --with-isl,
--with-isl-include, --with-isl-lib options, mutatis mutandis? This patch
does that.

	PR other/105527

gcc/ChangeLog:

	* doc/install.texi (Configuration): Add more details about --with-zstd.
	Document --with-zstd-include and --with-zstd-lib

Signed-off-by: Bruno Haible <bruno@clisp.org>
(cherry picked from commit 3677eb80b6)
2022-05-24 13:33:38 +02:00
Martin Liska f4c0f9257e docs: document --with-zstd
PR other/105527

gcc/ChangeLog:

	* doc/install.texi: Document the configure option --with-zstd.

(cherry picked from commit 8fa689767a)
2022-05-24 13:33:37 +02:00
GCC Administrator f0a0aeec44 Daily bump. 2022-05-24 00:19:29 +00:00
GCC Administrator dbca35e5f3 Daily bump. 2022-05-23 00:19:03 +00:00
GCC Administrator 6d1a2b2c89 Daily bump. 2022-05-22 00:19:11 +00:00
GCC Administrator e970ccbf3d Daily bump. 2022-05-21 00:19:12 +00:00
Peter Bergner c83d785850 rs6000: Prefer assigning the MMA vector operands to altivec registers [PR105556]
When optimizing the DGEMM kernel in OpenBLAS to use MMA, the MMA code
uses all 8 accumulators, which overlap all vs0-vs31 vector registers.
Current trunk assigns one of the normal vector inputs to one of the MMA
instructions, which forces us to spill one of the accumulators to memory,
leading to poor performance.  The solution here is to replace the "wa"
constraints for the vector input operands in the MMA instruction patterns
with "v,?wa" so that we prefer using the altivec registers vs32-vs63
over the vs0-vs31 registers.

2022-05-17  Peter Bergner  <bergner@linux.ibm.com>
	    Segher Boessenkool  <segher@kernel.crashing.org>

gcc/
	PR target/105556
	* config/rs6000/mma.md (mma_<vv>, mma_<avv>, mma_<pv>, mma_<apv>,
	mma_<vvi4i4i8>, mma_<avvi4i4i8>, mma_<vvi4i4i2>, mma_<avvi4i4i2>,
	mma_<vvi4i4>, mma_<avvi4i4>, mma_<pvi4i2>, mma_<apvi4i2>,
	mma_<vvi4i4i4>, mma_<avvi4i4i4>): Replace "wa" constraints with "v,?wa".
	Update other operands accordingly.

(cherry picked from commit c6e36f05fb)
2022-05-20 18:00:28 -05:00
Richard Biener fdf50499a4 tree-optimization/103116 - SLP permutes and peeling for gaps
The testcase shows that we can end up with a contiguous access across
loop iterations but by means of permutations the elements accessed
might only cover parts of a vector.  In this case we end up with
GROUP_GAP == 0 but still need to avoid accessing excess elements
in the last loop iterations.  Peeling for gaps is designed to cover
this but a single scalar iteration might not cover all of the excess
elements.  The following ensures peeling for gaps is done in this
situation and when that isn't sufficient because we need to peel
more than one iteration (gcc.dg/vect/pr103116-2.c), fail the SLP
vectorization.

2022-05-04  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/103116
	* tree-vect-stmts.cc (get_group_load_store_type): Handle the
	case we need peeling for gaps even though GROUP_GAP is zero.

	* gcc.dg/vect/pr103116-1.c: New testcase.
	* gcc.dg/vect/pr103116-2.c: Likewise.

(cherry picked from commit 52b7b86f8c)
2022-05-20 08:00:28 +02:00
GCC Administrator f682c64377 Daily bump. 2022-05-20 00:19:13 +00:00
Richard Biener 374cee99d0 tree-optimization/105618 - restore load sinking
The PR97330 fix caused some missed sinking of loads out of loops
the following patch re-instantiates.

2022-05-17  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/105618
	* tree-ssa-sink.cc (statement_sink_location): For virtual
	PHI uses ignore those defining the used virtual operand.

	* gcc.dg/tree-ssa/ssa-sink-19.c: New testcase.

(cherry picked from commit ebce0e9bd8)
2022-05-19 14:01:26 +02:00
Richard Biener 25d7a73810 rtl-optimization/105577 - testcase for the PR
2022-05-16  Richard Biener  <rguenther@suse.de>

	PR rtl-optimization/105577
	* g++.dg/torture/pr105577.C: New testcase.

(cherry picked from commit ef7b8976b9)
2022-05-19 14:00:59 +02:00
Richard Biener b251f8be6b rtl-optimization/105577 - RTL DSE and non-call EH
When one of the first two stages of DSE removes a throwing stmt
we have to purge dead EH edges before the DF re-analyze fires off
a fast DCE since that cannot cope with the situation.

2022-05-12  Richard Biener  <rguenther@suse.de>

	PR rtl-optimization/105577
	* dse.cc (rest_of_handle_dse): Make sure to purge dead EH
	edges before running fast DCE via df_analyze.

(cherry picked from commit dfda40f814)
2022-05-19 14:00:49 +02:00
Richard Biener 844a5c8ca7 tree-optimization/105562 - avoid uninit diagnostic with better FRE
We can avoid some uninit diagnostics by making FRE disambiguate
against CLOBBERs since any aliasing there would invoke undefined
behavior for a read we are looking up.

2022-05-12  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/105562
	* tree-ssa-sccvn.cc (vn_reference_lookup_3): Disambiguate
	against all CLOBBER defs if there's not an obvious must-alias
	and we are not doing redundant store elimination.
	(vn_walk_cb_data::redundant_store_removal_p): New field.
	(vn_reference_lookup_pieces): Initialize it.
	(vn_reference_lookup): Add argument to specify if we are
	doing redundant store removal.
	(eliminate_dom_walker::eliminate_stmt): Specify we do.
	* tree-ssa-sccvn.h (vn_reference_lookup): Adjust.

	* g++.dg/warn/uninit-pr105562.C: New testcase.

(cherry picked from commit 94b8a37fa1)
2022-05-19 13:59:30 +02:00
Richard Biener 2a040e9829 rtl-optimization/105559 - avoid quadratic behavior in delete_insn_and_edges
When the insn to delete is a debug insn there's no point in figuring
out whether it might be the last real insn and thus we have to purge
dead edges.

2022-05-11  Richard Biener  <rguenther@suse.de>

	PR rtl-optimization/105559
	* cfgrtl.cc (delete_insn_and_edges): Only perform search to BB_END
	for non-debug insns.

(cherry picked from commit 37a8220fa9)
2022-05-19 13:58:50 +02:00
Richard Biener a53eff4ad0 middle-end/105537 - debug processing
The following makes sure to have a consistent state of
flag_var_tracking_assignments with the distributed handling
in process_options and finish_options by moving everything to
finish_options which also restores diagnostics for
-g0 -fvar-tracking which was lost with previous changes.

2022-05-10  Richard Biener  <rguenther@suse.de>

	PR middle-end/105537
	* toplev.cc (process_options): Move flag_var_tracking
	handling ...
	* opts.cc (finish_options): ... here.

	* gcc.dg/torture/pr105537.c: New testcase.

(cherry picked from commit 76db543db8)
2022-05-19 13:58:31 +02:00
Richard Biener ad4fa189a7 Properly use opts in finish_options
When code was moved from process_options to finish_options it
was not properly adjusted to look at and alter the opts set
passed to the function but continued to modify the global options
set.  The following rectifies this and makes sure the same
mistake isn't repeated by poisoning global_options{,_set}.

2022-05-10  Richard Biener  <rguenther@suse.de>

	* flags.h (dwarf_debuginfo_p): Add opts argument, guard
	API with !GENERATOR_FILE.
	* opts.cc (global_options): Poison.
	(global_options_set): Likewise.
	(finish_options): Refer to options via opts.

(cherry picked from commit d469484610)
2022-05-19 13:58:21 +02:00
Richard Biener 1e43783b3f tree-optimization/105431 - another overflow in powi handling
This avoids undefined signed overflow when calling powi_as_mults_1.

2022-04-29  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/105431
	* tree-ssa-math-opts.cc (powi_as_mults_1): Make n unsigned.
	(powi_as_mults): Use absu_hwi.
	(gimple_expand_builtin_powi): Remove now pointless n != -n
	check.

(cherry picked from commit 44b09adb9b)
2022-05-19 13:56:48 +02:00
GCC Administrator 72c2898ccd Daily bump. 2022-05-19 00:18:47 +00:00
Eric Botcazou 696fce7368 Reduce usage of limited_with clauses with -fdump-ada-spec
The problem is that subtypes are not part of the limited view of a package
so we need to use types in conjunction with limited_with clauses, which is
not always desirable as this yields less portable Ada bindings.  The patch
also contains a small enhancement for complex floating-point types.

gcc/c-family/
	* c-ada-spec.cc (dump_ada_node) <COMPLEX_TYPE>: Deal with usual
	floating-point complex types.
	<POINTER_TYPE>: Do not use limited_with clause if the designated
	type is a scalar type.
2022-05-18 16:31:42 +02:00
Andrew MacLeod 9c8125b98c Check for equivalence after merging relations.
When registering a relation, we need to merge with any existing relation
before checking if it was an equivalence... otherwise it was not being
handled properly.

	gcc/
	PR tree-optimization/105458
	* value-relation.cc (path_oracle::register_relation): Merge, then check
	for equivalence.

	gcc/testsuite/
	* gcc.dg/pr105458.c: New.
2022-05-18 10:07:29 -04:00
GCC Administrator a048e606e6 Daily bump. 2022-05-18 00:19:18 +00:00
Jakub Jelinek 978036a016 libgomp: Clarify that omp_display_env is fully implemented
OpenMP 5.2 added
"When called from within a target region the effect is unspecified."
restriction to omp_display_env, so it is ok not to support it in
target regions (worst case we could add an empty implementation
or one with __builtin_trap in there).

2022-05-17  Jakub Jelinek  <jakub@redhat.com>

	* libgomp.texi (OpenMP 5.1): Remove "Not inside target regions"
	comment for omp_display_env feature.

(cherry picked from commit 741478ed3e)
2022-05-17 17:03:52 +02:00
GCC Administrator 325d82b086 Daily bump. 2022-05-17 00:18:54 +00:00
Sebastian Pop 5251647c84 [AArch64] add barriers to ool __sync builtins
2022-05-13  Sebastian Pop  <spop@amazon.com>

gcc/
	PR target/105162
	* config/aarch64/aarch64-protos.h (atomic_ool_names): Increase dimension
	of str array.
	* config/aarch64/aarch64.cc (aarch64_atomic_ool_func): Call
	memmodel_from_int and handle MEMMODEL_SYNC_*.
	(DEF0): Add __aarch64_*_sync functions.

gcc/testsuite/
	PR target/105162
	* gcc.target/aarch64/sync-comp-swap-ool.c: New.
	* gcc.target/aarch64/sync-op-acquire-ool.c: New.
	* gcc.target/aarch64/sync-op-full-ool.c: New.
	* gcc.target/aarch64/target_attr_20.c: Update check.
	* gcc.target/aarch64/target_attr_21.c: Same.

libgcc/
	PR target/105162
	* config/aarch64/lse.S: Define BARRIER and handle memory MODEL 5.
	* config/aarch64/t-lse: Add a 5th memory model for _sync functions.
2022-05-16 14:43:20 +00:00
Jonathan Wakely 9742709708 libstdc++: Fix hyperlink in docs
libstdc++-v3/ChangeLog:

	* doc/xml/manual/prerequisites.xml: Fix attributes for external
	hyperlink.
	* doc/html/manual/setup.html: Regenerate.

(cherry picked from commit 682e587f10)
2022-05-16 15:05:26 +01:00
Jonathan Wakely cfaf297e05 libstdc++: Update C++23 status docs
These are the C++23 proposals supported in the gcc-12 branch.

libstdc++-v3/ChangeLog:

	* doc/xml/manual/status_cxx2023.xml: Update with gcc-12 support.
	* doc/html/*: Regenerate.

(cherry picked from commit 8414dad54a)
2022-05-16 15:05:20 +01:00
Jonathan Wakely 228bd8151c libstdc++: Add C++23 status docs
These are the C++23 proposals already supported in the gcc-11 branch.

libstdc++-v3/ChangeLog:

	* doc/xml/manual/intro.xml: Include new chapter.
	* doc/xml/manual/status_cxx2020.xml: Tweak release numbers.
	* doc/xml/manual/status_cxx2023.xml: New file.
	* doc/html/*: Regenerate.

(cherry picked from commit 4361867344)
2022-05-16 15:04:56 +01:00
Jonathan Wakely 02acb54c6e libstdc++: Fix status docs for <bit> support
libstdc++-v3/ChangeLog:

	* doc/html/manual/status.html: Regenerate.
	* doc/xml/manual/status_cxx2020.xml: Fix supported version for
	C++20 bit operations.

(cherry picked from commit 64648821f1)
2022-05-16 15:04:05 +01:00
Richard Biener 9b5109971b ipa/105598 - testcase for PR105598
2022-05-16  Richard Biener  <rguenther@suse.de>

gcc/testsuite/
	* gcc.dg/torture/pr105598.c: New testcase.

(cherry picked from commit 6230911cb9)
2022-05-16 12:04:15 +02:00
Eric Botcazou ad05a1d7f8 Do not use DW_OP_not for TRUTH_NOT_EXPR in conditional expressions
DW_OP_not is a bitwise, not a logical NOT, so it computes the wrong result
in a DWARF conditional expression.

gcc/
	* dwarf2out.cc (loc_list_from_tree_1) <TRUTH_NOT_EXPR>: Do a logical
	instead of a bitwise negation.
	<COND_EXPR>: Swap the operands if the condition is TRUTH_NOT_EXPR.
2022-05-16 11:08:47 +02:00
GCC Administrator c6ca39c7bf Daily bump. 2022-05-16 00:19:11 +00:00
Iain Buclaw 0556c356e5 d: Merge upstream dmd a53934d18, phobos 604534d7c.
D front-end changes:

    - Import dmd v2.100.0.

Phobos changes:

    - Import phobos v2.100.0.

gcc/d/ChangeLog:

	* dmd/MERGE: Merge upstream dmd a53934d18.
	* dmd/VERSION: Update version to v2.100.0.
	* d-codegen.cc (d_decl_context): Use resolvedLinkage to get
	declaration linkage.
	(build_struct_literal): Track offset in bits.
	* d-gimplify.cc (d_gimplify_modify_expr): Check both operands for a
	bit-field reference.
	* d-lang.cc (d_post_options): Set flag_rtti and flag_exceptions if
	-fno-druntime was seen on command-line.
	(d_type_promotes_to): Use resolvedLinkage to get declaration linkage.
	* decl.cc (make_thunk): Likewise.
	* types.cc (layout_aggregate_members): Ignore anonymous fields in
	total count.

libphobos/ChangeLog:

	* src/MERGE: Merge upstream phobos 604534d7c.
2022-05-16 00:56:06 +02:00
Jason Merrill 40f749b364 c++: array {}-init [PR105589]
My patch for 105191 made us use build_value_init more frequently from
build_vec_init_expr, but build_value_init doesn't like to be called to
initialize a class in a template.  That's caused trouble in the past, and
seems like a strange restriction, so let's fix it.

	PR c++/105589
	PR c++/105191
	PR c++/92385

gcc/cp/ChangeLog:

	* init.cc (build_value_init): Handle class in template.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/initlist-array16.C: New test.
2022-05-15 12:29:04 -04:00
Jason Merrill 73b47159d7 c++: alias CTAD and member alias templates [PR104470]
In this testcase, we were trying to substitute into
variant<Foo<T>>::__accepted_type, but failed to look it up because
variant<Foo<T>> doesn't exist.  In other cases we already rewrite such
things into a dependent reference; we need to do that for alias templates as
well.

This caused some testsuite regressions on alias uses outside of deduction
guides, so I've made all of this rewriting conditional on a new tf_dguide
tsubst flag.

	PR c++/104470

gcc/cp/ChangeLog:

	* cp-tree.h (enum tsubst_flags): Add tf_dguide.
	* pt.cc (tsubst_aggr_type): Check it.
	(tsubst_baselink, tsubst_copy): Check it.
	(maybe_dependent_member_ref): Check it.
	(instantiate_alias_template): Handle it.
	(build_deduction_guide): Set it.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp2a/explicit11.C: Second example also ill-formed.
	* g++.dg/cpp2a/class-deduction-alias12.C: New test.
2022-05-15 05:47:40 -04:00
Jason Merrill 5237059e04 c++: typeid and instantiation [PR102651]
PR49387 was a problem with initially asking for a typeid for a class
template specialization before it was complete, and later actually filling
in the descriptor when the class was complete, and thus disagreeing on the
form of the descriptor.  I fixed that by forcing the class to be complete,
but this testcase shows why that approach is problematic.  So instead let's
adjust the type of the descriptor later if needed.

	PR c++/102651
	PR c++/49387

gcc/cp/ChangeLog:

	* rtti.cc (get_tinfo_decl_direct): Don't complete_type.
	(emit_tinfo_decl): Update tdesc type if needed.

gcc/testsuite/ChangeLog:

	* g++.dg/rtti/typeid-complete1.C: New test.
2022-05-15 05:47:40 -04:00
GCC Administrator dbd77e660f Daily bump. 2022-05-15 00:18:55 +00:00