[Clang][OpenMP] Fixed an assertion when `#pragma omp declare simd` or `#pragma omp declare variant` is followed by another OpenMP declarative directive containing a qualified identifier (#217875)
For code
```cpp
void foo();
#pragma omp declare simd
#pragma omp declare target to(foo)
```
Clang currently accepts this without rejection. The underlying cause is
that OpenMP pragma parsing for directives like `declare target to(...)`
performs name lookup without advancing the source location to create a
new declaration. As a result, the parser fetches the existing Decl of
foo and passes it up to declare simd, silently bypassing Sema
diagnostics.
https://godbolt.org/z/szPne5n45
---
[27 lines not shown]
[LAA] ZExt size from deref bundles to widest type. (#217939)
The size in a dereferenceable bundle may have a different bitwidth than
the access size. Both are interpreted as unsigned values. Update
WidestTy to account for possibility of the type for the bundle being
narrower.
Fixes a crash similar to
https://github.com/llvm/llvm-project/pull/217770.
PR: https://github.com/llvm/llvm-project/pull/217939
[SCEV] Avoid overflow in howManyGreaterThans. (#217744)
howManyGreaterThans computes the backedge-taken count as ((Start - End)
+ (Stride - 1)) /u Stride. The addition can overflow, causing incorrect
results.
Instead, use getUDivCeilSCEV if Start >= End, mirroring
howManyLessThans. It also has additional handling for stride being a
power of 2, which allows using the simpler formula in more cases.
I'll check if we can unify the code (as implied by the FIXME I think),
instead of duplicating more logic.
Fixes https://github.com/llvm/llvm-project/issues/217537.
Fixes https://github.com/llvm/llvm-project/issues/187472.
PR: https://github.com/llvm/llvm-project/pull/217744
[clang-tidy] Fix crashes when analyzing unknown exceptions in bugprone-exception-escape (#218067)
`ExceptionAnalyzer` represents exceptions of unknown type with a null
`Type`, but some consumers dereferenced it unconditionally, resulting in
a crash when `TreatFunctionsWithoutSpecificationAsThrowing` is enabled.
This commit fixes the problem by skipping type-dependent processing for
unknown exceptions.
Fixes #217649