2 Commits

Author SHA1 Message Date
Reid Kleckner
3c42e10afd
Consider aggregate bases when checking if an InitListExpr is constant (#80519)
This code was correct as written prior to C++17, which allowed bases to
appear in the initializer list.

This was observable by creating non-constant aggregate initialization at
file scope in a compound literal, but since that behavior will change
soon if we implement support for dynamic initialization, I also added a
unit test for `isConstantInitializer`.

This fixes at least one part of issue #80510 .

---------

Co-authored-by: Aaron Ballman <aaron@aaronballman.com>
2024-02-08 14:27:14 -08:00
Chris Cotter
58ec6e09ab [NFC] [clang] Forward forwarding reference
Update function bodies to forward forwarding references.
I spotted this while authoring a clang-tidy tool for CppCoreGuideline F.19

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D143877
2023-02-28 01:27:21 +00:00