[clang-tidy] Fix false positive in misc-redundant-expression with type aliases (#198085)
The `misc-redundant-expression` check previously flagged expressions as
redundant if their underlying `DeclRefExpr` pointed to the same
declaration. This caused false positives when comparing identical values
accessed through distinct type aliases.
Following Clang's diagnostic `aka` logic, this patch uses the AST
Printer to stringify and compare the `NestedNameSpecifier` and
`TemplateArguments`. This safely preserves sugared types while natively
normalizing all whitespaces and newlines, ensuring robustness against
multiline formatting changes.
Fixes #145415
[flang] Propagate INTENT(IN) dummy arguments as readonly (#207732)
Mark eligible `INTENT(IN)` dummy data objects with a `fir.read_only`
argument attribute during lowering, and teach `FunctionAttr` to
translate the marker to LLVM `readonly` for reference arguments when
optimizing for speed.
LLVM FunctionAttrs can infer `readonly` later in the pipeline, but this
happens too late for IPSCCP function specialization.
`FunctionSpecializer::promoteConstantStackValues` requires
`onlyReadsMemory()` before promoting constant by-reference scalar
arguments. Providing `readonly` satisfies this check and allows these
arguments to be promoted, enabling function specialization, including in
non-LTO builds.
For direct-data arguments, restrict propagation to by-reference
non-character intrinsic scalars. Ordinary arrays and derived-type
arguments are excluded because compiler-generated copy-out may write
back through a forwarded dummy argument. LLVM `readonly` does not permit
[30 lines not shown]
[orc-rt] Statically check logging category/level name array sizes. (#209372)
Add static_asserts to trigger compilation failure if the sizes of these
arrays don't match their respective enum/macro value ranges.
[Object] Fix irsymtab CommonSize truncation past 4 GiB (#209085)
Fixes #208669
Issue :
With -flto, Fortran COMMON blocks larger than 4 GiB were silently
miscompiled. The linker reserved only the low 32 bits of the declared
size, so stores past that boundary could segfault with no diagnostic.
Root Cause :
storage::Uncommon::CommonSize in the LTO irsymtab was stored as 32-bit
(Word). Sizes above 2^32 bytes were truncated when the symtab was
written and read back at link time.
Fix :
Widen CommonSize to 64-bit and bump irsymtab format version to 4. Added
test to verify symtab records the full size.
[libc][realpath] Validate path components.
This PR updates `realpath` to validate paths and return `ENOTDIR` or `ENOENT` according to https://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html.
This PR also bumps the memory limit in `HermeticTestUtils.cpp`. The realpath unit tests allocate quite a few strings. Since memory in hermetic tests is never free'd, the unit test quickly reaches the limit.
[libc][realpath][test] Create test files/directories
Follow-up PRs will add path validation etc to `realpath`, which will require paths to exist in the filesystem.
[libc][realpath][test] Create test files/directories
Follow-up PRs will add path validation etc to `realpath`, which will require paths to exist in the filesystem.
[libc][realpath] Validate path components.
This PR updates `realpath` to validate paths and return `ENOTDIR` or `ENOENT` according to https://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html.
This PR also bumps the memory limit in `HermeticTestUtils.cpp`. The realpath unit tests allocate quite a few strings. Since memory in hermetic tests is never free'd, the unit test quickly reaches the limit.
multimedia/qt6-multimedia: Mask X11-only headers
When the Qt stack is built with X11 disabled globally, certain private
headers should not be included in the final pkg-plist.
This does not affect the default settings, so not bumping PORTREVISON.
Reported by: angry_vincent on #freebsd-desktop
MFH: 2026Q3
(cherry picked from commit 7ae4bbc02b5b96936d4bef4bb2561d38b704def3)
finance/ktoblzcheck-data: Update bank data
Bank data is valid from 2026-06-08 until 2026-09-06.
Integrate my data update script into the port to keep it under version
control, easier future updates of the port, and for full transparency.
MFH: 2026Q3
(cherry picked from commit 4439524120c6e2c84d3d7394e000024624dd31a2)
[libc][realpath] Validate path components.
This PR updates `realpath` to validate paths and return `ENOTDIR` or `ENOENT` according to https://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html.
This PR also bumps the memory limit in `HermeticTestUtils.cpp`. The realpath unit tests allocate quite a few strings. Since memory in hermetic tests is never free'd, the unit test quickly reaches the limit.
[libc][realpath][test] Create test files/directories
Follow-up PRs will add path validation etc to `realpath`, which will require paths to exist in the filesystem.
[flang] Add kind-preservation regression tests (#208760)
These tests pin currently-correct behaviors where the KIND type
parameter of a result must be preserved by constant folding, semantics,
and lowering. They all pass at head; their purpose is to guard against
silent kind loss during future refactoring of the Evaluate library's
type-parameterized machinery (see the discussion on PR #206907, where an
experimental rewrite passed check-flang while dropping kinds in several
places).
Folded LOGICAL operations: `.NOT./.AND./.OR./.EQV./.NEQV.` keep their
operand kind; ANY/ALL/PARITY and logical DOT_PRODUCT results have the
MASK/argument kind (F2023 16.9.14/16.9.16/16.9.148), including for empty
masks where there is no element value to take a kind from; MERGE and
TRANSFER keep the TSOURCE/MOLD kind; STORAGE_SIZE of folded
non-default-kind logicals folds to the right value; the default BOUNDARY
fill element of a folded EOSHIFT has the array's kind; relational
results are default logical regardless of operand kinds; and generic
resolution over LOGICAL kinds is unchanged by folding
[18 lines not shown]
[libunwind][test] Add .clang-format
Borrow from `libcxx/test/.clang-format` to avoid `clang-format`
suggestions that are incompatible with `FileCheck`.
finance/ktoblzcheck-data: Update bank data
Bank data is valid from 2026-06-08 until 2026-09-06.
Integrate my data update script into the port to keep it under version
control, easier future updates of the port, and for full transparency.
MFH: 2026Q2
[flang][cuda] Implicitly attribute allocatables/pointers under -gpu=unified (#209292)
When `-gpu=unified` is in effect, allocatables and pointers with no
explicit CUDA data attribute were left with no data attribute, and were allocated
as ordinary host memory. Under unified memory, such objects must be
reachable from the device; leaving them as plain host allocations makes device kernels
fault on systems that do not provide transparent host-memory access.
The existing code here already assigned `Managed` implicitly under
`-gpu=managed` (when CUDA Fortran is enabled). This extends that handling to
`-gpu=unified`: prefer the `Unified` attribute where it is legal (host subprogram, main
program, or derived-type component) so generic resolution still selects the unified
specific, and fall back to `Managed` elsewhere (module scope, device
subprograms). Both attributes route allocation through the same managed
allocator, so this keeps the allocation device-accessible while avoiding
spurious `ATTRIBUTES(UNIFIED)` legality errors.
The attribution stays gated on CUDA Fortran being enabled, preserving
the existing behavior for non-CUDA-Fortran translation units.