aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaCast.cpp
AgeCommit message (Collapse)AuthorFilesLines
2025-08-28[clang] Create PointerToBoolean casts for C casts (#155368)Timm Baeder1-1/+6
Don't create CK_BitCast casts from `nullptr_t` to `bool`. Fixes #155126
2025-08-27[clang] AST: fix getAs canonicalization of leaf types (#155028)Matheus Izvekov1-3/+4
2025-08-26[clang] NFC: introduce Type::getAsEnumDecl, and cast variants for all ↵Matheus Izvekov1-2/+1
TagDecls (#155463) And make use of those. These changes are split from prior PR #155028, in order to decrease the size of that PR and facilitate review.
2025-08-25[clang] NFC: change more places to use Type::getAsTagDecl and friends (#155313)Matheus Izvekov1-11/+9
This changes a bunch of places which use getAs<TagType>, including derived types, just to obtain the tag definition. This is preparation for #155028, offloading all the changes that PR used to introduce which don't depend on any new helpers.
2025-08-09[clang] Improve nested name specifier AST representation (#147835)Matheus Izvekov1-26/+25
This is a major change on how we represent nested name qualifications in the AST. * The nested name specifier itself and how it's stored is changed. The prefixes for types are handled within the type hierarchy, which makes canonicalization for them super cheap, no memory allocation required. Also translating a type into nested name specifier form becomes a no-op. An identifier is stored as a DependentNameType. The nested name specifier gains a lightweight handle class, to be used instead of passing around pointers, which is similar to what is implemented for TemplateName. There is still one free bit available, and this handle can be used within a PointerUnion and PointerIntPair, which should keep bit-packing aficionados happy. * The ElaboratedType node is removed, all type nodes in which it could previously apply to can now store the elaborated keyword and name qualifier, tail allocating when present. * TagTypes can now point to the exact declaration found when producing these, as opposed to the previous situation of there only existing one TagType per entity. This increases the amount of type sugar retained, and can have several applications, for example in tracking module ownership, and other tools which care about source file origins, such as IWYU. These TagTypes are lazily allocated, in order to limit the increase in AST size. This patch offers a great performance benefit. It greatly improves compilation time for [stdexec](https://github.com/NVIDIA/stdexec). For one datapoint, for `test_on2.cpp` in that project, which is the slowest compiling test, this patch improves `-c` compilation time by about 7.2%, with the `-fsyntax-only` improvement being at ~12%. This has great results on compile-time-tracker as well: ![image](https://github.com/user-attachments/assets/700dce98-2cab-4aa8-97d1-b038c0bee831) This patch also further enables other optimziations in the future, and will reduce the performance impact of template specialization resugaring when that lands. It has some other miscelaneous drive-by fixes. About the review: Yes the patch is huge, sorry about that. Part of the reason is that I started by the nested name specifier part, before the ElaboratedType part, but that had a huge performance downside, as ElaboratedType is a big performance hog. I didn't have the steam to go back and change the patch after the fact. There is also a lot of internal API changes, and it made sense to remove ElaboratedType in one go, versus removing it from one type at a time, as that would present much more churn to the users. Also, the nested name specifier having a different API avoids missing changes related to how prefixes work now, which could make existing code compile but not work. How to review: The important changes are all in `clang/include/clang/AST` and `clang/lib/AST`, with also important changes in `clang/lib/Sema/TreeTransform.h`. The rest and bulk of the changes are mostly consequences of the changes in API. PS: TagType::getDecl is renamed to `getOriginalDecl` in this patch, just for easier to rebasing. I plan to rename it back after this lands. Fixes #136624 Fixes https://github.com/llvm/llvm-project/issues/43179 Fixes https://github.com/llvm/llvm-project/issues/68670 Fixes https://github.com/llvm/llvm-project/issues/92757
2025-07-11[clang] Fix static_cast bypassing access control (#132285)offsetof1-13/+11
Fix access and ambiguity checks not being performed when converting to an rvalue reference to a base class type with `static_cast`. Fixes #121429 --------- Co-authored-by: Corentin Jabot <corentinjabot@gmail.com>
2025-06-26[Clang] Back out the source location workaround for CXXConstructExpr (#145260)Younan Zhang1-83/+109
This removes the workaround introduced in 3e1a9cf3b8 and 1ba7dc38d. The workaround overwrote the right parenthesis location of the sub expression, which could be wrong when a CXXTemporaryObjectExpr occurs within a nested expression, e.g. `A(A(1, 2))`. To completely take it down, we now propagate the left parenthesis source location throughout SemaCast, such that the ParenOrBraceRange can be properly set at the point of its creation. Fixes https://github.com/llvm/llvm-project/issues/143711
2025-06-18[Sema][ObjC] Loosen restrictions on reinterpret_cast involving indirect ↵Akira Hatanaka1-4/+7
ARC-managed pointers (#144458) Allow using reinterpret_cast for conversions between indirect ARC pointers and other pointer types. rdar://152905399
2025-04-15[PAC] Add support for __ptrauth type qualifier (#100830)Akira Hatanaka1-1/+18
The qualifier allows programmer to directly control how pointers are signed when they are stored in a particular variable. The qualifier takes three arguments: the signing key, a flag specifying whether address discrimination should be used, and a non-negative integer that is used for additional discrimination. ``` typedef void (*my_callback)(const void*); my_callback __ptrauth(ptrauth_key_process_dependent_code, 1, 0xe27a) callback; ``` Co-Authored-By: John McCall rjmccall@apple.com
2025-04-15Silence -Wcast-function-type warnings on idiomatic Windows code (#135660)Aaron Ballman1-0/+23
On Windows, GetProcAddress() is the API used to dynamically load function pointers (similar to dlsym on Linux). This API returns a function pointer (a typedef named FARPROC), which means that casting from the call to the eventual correct type is technically a function type mismatch on the cast. However, because this is idiomatic code on Windows, we should accept it unless -Wcast-function-type-strict is passed. This was brought up in post-commit review feedback on https://github.com/llvm/llvm-project/pull/86131
2025-04-02[C23] Allow casting from a null pointer constant to nullptr_t (#133742)Aaron Ballman1-8/+17
C23 allows a cast of a null pointer constant to nullptr_t. e.g., (nullptr_t)0 or (nullptr_t)(void *)0. Fixes #133644
2025-03-21Reland: [clang] preserve class type sugar when taking pointer to member ↵Matheus Izvekov1-2/+2
(#132401) Original PR: #130537 Originally reverted due to revert of dependent commit. Relanding with no changes. This changes the MemberPointerType representation to use a NestedNameSpecifier instead of a Type to represent the base class. Since the qualifiers are always parsed as nested names, there was an impedance mismatch when converting these back and forth into types, and this led to issues in preserving sugar. The nested names are indeed a better match for these, as the differences which a QualType can represent cannot be expressed syntatically, and they represent the use case more exactly, being either dependent or referring to a CXXRecord, unqualified. This patch also makes the MemberPointerType able to represent sugar for a {up/downcast}cast conversion of the base class, although for now the underlying type is canonical, as preserving the sugar up to that point requires further work. As usual, includes a few drive-by fixes in order to make use of the improvements.
2025-03-20Revert "Reland: [clang] preserve class type sugar when taking pointer to ↵Matheus Izvekov1-2/+2
member" (#132280) Reverts llvm/llvm-project#132234 Needs to be reverted due to dependency. This blocks reverting another PR, see here: https://github.com/llvm/llvm-project/pull/131965#issuecomment-2741619498
2025-03-20Reland: [clang] preserve class type sugar when taking pointer to member ↵Matheus Izvekov1-2/+2
(#132234) Original PR: #130537 Reland after updating lldb too. This changes the MemberPointerType representation to use a NestedNameSpecifier instead of a Type to represent the base class. Since the qualifiers are always parsed as nested names, there was an impedance mismatch when converting these back and forth into types, and this led to issues in preserving sugar. The nested names are indeed a better match for these, as the differences which a QualType can represent cannot be expressed syntatically, and they represent the use case more exactly, being either dependent or referring to a CXXRecord, unqualified. This patch also makes the MemberPointerType able to represent sugar for a {up/downcast}cast conversion of the base class, although for now the underlying type is canonical, as preserving the sugar up to that point requires further work. As usual, includes a few drive-by fixes in order to make use of the improvements.
2025-03-20Revert "[clang] improve class type sugar preservation in pointers to ↵Matheus Izvekov1-2/+2
members" (#132215) Reverts llvm/llvm-project#130537 This missed updating lldb, which we didn't notice due to lack of pre-commit CI.
2025-03-20[clang] improve class type sugar preservation in pointers to members (#130537)Matheus Izvekov1-2/+2
This changes the MemberPointerType representation to use a NestedNameSpecifier instead of a Type to represent the class. Since the qualifiers are always parsed as nested names, there was an impedance mismatch when converting these back and forth into types, and this led to issues in preserving sugar. The nested names are indeed a better match for these, as the differences which a QualType can represent cannot be expressed syntactically, and it also represents the use case more exactly, being either dependent or referring to a CXXRecord, unqualified. This patch also makes the MemberPointerType able to represent sugar for a {up/downcast}cast conversion of the base class, although for now the underlying type is canonical, as preserving the sugar up to that point requires further work. As usual, includes a few drive-by fixes in order to make use of the improvements, and removing some duplications, for example CheckBaseClassAccess is deduplicated from across SemaAccess and SemaCast.
2025-03-19[clang] NFC: Unify implementations of CheckMemberPointerConversion (#131966)Matheus Izvekov1-64/+14
This deduplicates the implementation of CheckMemberPointerConversion accross SemaCast and SemaOverload.
2025-02-18[HLSL] Allow arrays to copy-initialize (#127557)Chris B1-33/+54
This change allows array variables to copy-initialize from other arrays. It also corrects a small error in HLSL C-Style casting that did not error on casting to arrays if elementwise and splat conversions fail. Fixes #127551
2025-02-14[HLSL] Implement HLSL Aggregate splatting (#118992)Sarah Spall1-2/+24
Implement HLSL Aggregate Splat casting that handles splatting for arrays and structs, and vectors if splatting from a vec1. Closes #100609 and Closes #100619 Depends on #118842
2025-02-07[HLSL] Implement HLSL Elementwise casting (excluding splat cases); Re-land ↵Sarah Spall1-3/+17
#118842 (#126258) Implement HLSLElementwiseCast excluding support for splat cases Do not support casting types that contain bitfields. Partly closes https://github.com/llvm/llvm-project/issues/100609 and partly closes https://github.com/llvm/llvm-project/issues/100619 Re-land #118842 after fixing warning as an error, found by a buildbot.
2025-02-06Revert "[HLSL] Implement HLSL Flat casting (excluding splat cases)" (#126149)Sarah Spall1-17/+3
Reverts llvm/llvm-project#118842
2025-02-06[HLSL] Implement HLSL Flat casting (excluding splat cases) (#118842)Sarah Spall1-3/+17
Implement HLSLElementwiseCast excluding support for splat cases Do not support casting types that contain bitfields. Partly closes #100609 and partly closes #100619
2025-01-20[clang] Fix false warning on reinterpret_casting unknown template type (#109430)Arseniy Zaostrovnykh1-0/+4
After 1595988ee6f9732e7ea79928af8a470ad5ef7dbe diag::warn_undefined_reinterpret_cast started raising on non-instantiated template functions without sufficient knowledge whether the reinterpret_cast is indeed UB.
2024-11-16[Sema] Remove unused includes (NFC) (#116461)Kazu Hirata1-1/+0
Identified with misc-include-cleaner.
2024-11-15[Clang] Use TargetInfo when deciding if an address space is compatible ↵Joseph Huber1-7/+12
(#115777) Summary: Address spaces are used in several embedded and GPU targets to describe accesses to different types of memory. Currently we use the address space enumerations to control which address spaces are considered supersets of eachother, however this is also a target level property as described by the C standard's passing mentions. This patch allows the address space checks to use the target information to decide if a pointer conversion is legal. For AMDGPU and NVPTX, all supported address spaces can be converted to the default address space. More semantic checks can be added on top of this, for now I'm mainly looking to get more standard semantics working for C/C++. Right now the address space conversions must all be done explicitly in C/C++ unlike the offloading languages which define their own custom address spaces that just map to the same target specific ones anyway. The main question is if this behavior is a function of the target or the language.
2024-11-13[Clang] enhance diagnostic message for __builtin_bit_cast size mismatch ↵Oleksandr T.1-1/+2
(#115940) Fixes #115870
2024-09-18[clang][Sema] Fix assertion in `tryDiagnoseOverloadedCast` (#108021)Alejandro Álvarez Ayllón1-1/+6
Fixed an assertion failure in debug mode, and potential crashes in release mode, when diagnosing a failed cast caused indirectly by a failed implicit conversion to the type of the constructor parameter. For instance ``` template<typename> struct StringTrait {}; template< int N > struct StringTrait< const char[ N ] > { typedef char CharType; static const MissingIntT length = N - 1; }; class String { public: template <typename T> String(T& str, typename StringTrait<T>::CharType = 0); }; class Exception { public: Exception(String const&); }; void foo() { throw Exception("some error"); } ``` `Exception(String const&)` is a matching constructor for `Exception` from a `const char*`, via an implicit conversion to `String`. However, the instantiation of the `String` constructor will fail because of the missing type `MissingIntT` inside the specialization of `StringTrait`. When trying to emit a diagnosis, `tryDiagnoseOverloadedCast` expects not to have a matching constructor, but there is; it just could not be instantiated.
2024-08-29[NFC][Sema] Move `Sema::AssignmentAction` into its own scoped enum (#106453)Dan Liew1-2/+2
The primary motivation behind this is to allow the enum type to be referred to earlier in the Sema.h file which is needed for #106321. It was requested in #106321 that a scoped enum be used (rather than moving the enum declaration earlier in the Sema class declaration). Unfortunately doing this creates a lot of churn as all use sites of the enum constants had to be changed. Appologies to all downstream forks in advanced. Note the AA_ prefix has been dropped from the enum value names as they are now redundant.
2024-07-01[clang][NFC] Move documentation of `Sema` functions into `Sema.h`Vlad Serebrennikov1-2/+0
This patch moves documentation of `Sema` functions from `.cpp` files to `Sema.h` when there was no documentation in the latter, or it can be trivially subsumed. More complicated cases when there's less trivial divergence between documentation attached to declaration and the one attached to implementation are left for a later PR that would require review. It appears that doxygen can find the documentation for a function defined out-of-line even if it's attached to an implementation, and not declaration. But other tools, e.g. clangd, are not as powerful. So this patch significantly improves autocompletion experience for (at least) clangd-based IDEs.
2024-06-03[clang][Sema] Don't issue -Wcast-function-type-mismatch for enums with a ↵Raul Tambre1-3/+4
matching underlying type (#87793) Enums are passed as their underlying integral type so they're ABI compatible if the size matches. Useful with C APIs that pass user-controlled values to callbacks that can be made type safe by using enumerations (e.g. GStreamer). Discovered internally in some code after 999d4f840777bf8de26d45947192aa0728edc0fb.
2024-05-22[clang] Introduce `SemaRISCV` (#92682)Vlad Serebrennikov1-2/+3
This patch moves `Sema` functions that are specific for RISC-V into the new `SemaRISCV` class. This continues previous efforts to split `Sema` up. Additional context can be found in https://github.com/llvm/llvm-project/pull/84184. This PR is somewhat different from previous PRs on this topic: 1. Splitting out target-specific functions wasn't previously discussed. It felt quite natural to do, though. 2. I had to make some static function in `SemaChecking.cpp` member functions of `Sema` in order to use them in `SemaRISCV`. 3. I dropped "RISCV" from identifiers, but decided to leave "RVV" (RISC-V "V" vector extensions) intact. I think it's an idiomatic abbreviation at this point, but I'm open to input from contributors in that area. 4. I repurposed `SemaRISCVVectorLookup.cpp` for `SemaRISCV`. I think this was a successful experiment, which both helps the goal of splitting `Sema` up, and shows a way to approach `SemaChecking.cpp`, which I wasn't sure how to approach before. As we move more target-specific function out of there, we'll gradually make the checking "framework" inside `SemaChecking.cpp` public, which is currently a whole bunch of static functions. This would enable us to move more functions outside of `SemaChecking.cpp`.
2024-05-13[clang] Introduce `SemaObjC` (#89086)Vlad Serebrennikov1-6/+7
This is continuation of efforts to split `Sema` up, following the example of OpenMP, OpenACC, etc. Context can be found in https://github.com/llvm/llvm-project/pull/82217 and https://github.com/llvm/llvm-project/pull/84184. I split formatting changes into a separate commit to help reviewing the actual changes.
2024-04-17[clang][NFC] Refactor `Sema::CheckedConversionKind`Vlad Serebrennikov1-38/+35
Convert it to scoped enum, and move it to namespace scope to enable forward declarations.
2024-04-14[clang] Fix -Wunused-variable in SemaCast.cpp (NFC)Jie Fu1-1/+1
llvm-project/clang/lib/Sema/SemaCast.cpp:503:23: error: unused variable 'Res' [-Werror,-Wunused-variable] OverloadingResult Res = ^ 1 error generated.
2024-04-14[Clang] [C++26] Implement P2573R2: `= delete("should have a reason");` (#86526)Sirraide1-4/+16
This implements support for the `= delete("message")` syntax that was only just added to C++26 ([P2573R2](https://isocpp.org/files/papers/P2573R2.html#proposal-scope)).
2023-10-31[clang][NFC] Refactor `VectorType::VectorKind`Vlad Serebrennikov1-4/+4
This patch moves `VectorKind` to namespace scope, and make it complete at the point its bit-field is declared. It also converts it to a scoped enum.
2023-10-24[clang][Sema] Correct end for the `CastOperation.OpRange` (#69480)Botond István Horváth1-1/+1
Set the correct end for the CastOperation.OpRange in CXXFunctionalCastExpr. Now it is the closing bracket's location instead of the parameter's location. This can lead to better highlight in the diagnostics. Similar to https://github.com/llvm/llvm-project/pull/66853 Before: warning: cast from 'long (*)(const int &)' to 'decltype(fun_ptr)' (aka 'long (*)(int &)') converts to incompatible function type [-Wcast-function-type-strict] 24 | return decltype(fun_ptr)( f_ptr /*comment*/); | ^~~~~~~~~~~~~~~~~~~~~~~~ After: warning: cast from 'long (*)(const int &)' to 'decltype(fun_ptr)' (aka 'long (*)(int &)') converts to incompatible function type [-Wcast-function-type-strict] 24 | return decltype(fun_ptr)( f_ptr /*comment*/); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reviewed By: AaronBallman, tbaederr GitHub PR: https://github.com/llvm/llvm-project/pull/69480
2023-09-05[Sema] Make C++ functional-style cast warn about dropped qualifiers ↵Kristina Bessonova1-0/+3
(-Wcast-qual) Functional-style cast (i.e. a simple-type-specifier or typename-specifier followed by a parenthesize single expression [expr.type.conv]) is equivalent to the C-style cast, so that makes sense they have identical behavior including warnings. This also matches GCC https://godbolt.org/z/b8Ma9Thjb. Reviewed By: rnk, aaron.ballman Differential Revision: https://reviews.llvm.org/D159133
2023-08-11[C23] Rename C2x -> C23; NFCAaron Ballman1-2/+2
This does the rename for most internal uses of C2x, but does not rename or reword diagnostics (those will be done in a follow-up). I also updated standards references and citations to the final wording in the standard.
2023-08-02Reland "For #64088: mark vtable as used if we might emit a reference to it."Dmitry Chernenkov1-0/+8
This reverts commit 3b34d69ac7a643742364be3591b324ddd14ef9aa.
2023-07-28Revert "For #64088: mark vtable as used if we might emit a reference to it."Dmitry Chernenkov1-8/+0
This reverts commit b6847edfc235829b37dd6d734ef5bbfa0a58b6fc.
2023-07-25For #64088: mark vtable as used if we might emit a reference to it.Richard Smith1-0/+8
2023-07-18[clang] Fix a crash when casting to an array typeAlan Zhao1-1/+19
In C++20, if Clang fails to perform constructor overload on a RecordType, then Clang will try to perform parentesized aggregate initialization. If that fails and the initialization was attempted as part of a cast, then we should get the diagnostics from the failed constructor overload attempt. However, we don't attempt constructor overloading for arrays, so previously, if we try to diagnose an overloaded cast for a parenthesized aggregate initialization of an array, we crash. To fix this, we now exit tryDiagnoseOverloadedCast(...) for failed parentesized list initialization if the destination type is an array. Fixes #63758 Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D155523
2023-06-25[llvm] Add missing StringExtras.h includesElliot Goodrich1-0/+1
In preparation for removing the `#include "llvm/ADT/StringExtras.h"` from the header to source file of `llvm/Support/Error.h`, first add in all the missing includes that were previously included transitively through this header.
2023-06-10[clang][WebAssembly] Implement support for table types and builtinsPaulo Matos1-0/+16
This commit implements support for WebAssembly table types and respective builtins. Table tables are WebAssembly objects to store reference types. They have a large amount of semantic restrictions including, but not limited to, only being allowed to be declared at the top-level as static arrays of zero-length. Not being arguments or result of functions, not being stored ot memory, etc. This commit introduces the __attribute__((wasm_table)) to attach to arrays of WebAssembly reference types. And the following builtins to manage tables: * ref __builtin_wasm_table_get(table, idx) * void __builtin_wasm_table_set(table, idx, ref) * uint __builtin_wasm_table_size(table) * uint __builtin_wasm_table_grow(table, ref, uint) * void __builtin_wasm_table_fill(table, idx, ref, uint) * void __builtin_wasm_table_copy(table, table, uint, uint, uint) This commit also enables reference-types feature at bleeding-edge. This is joint work with Alex Bradbury (@asb). Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D139010
2023-05-27[Clang][BFloat16] Upgrade __bf16 to arithmetic type, change mangling, and ↵M. Zeeshan Siddiqui1-14/+0
extend excess precision support Pursuant to discussions at https://discourse.llvm.org/t/rfc-c-23-p1467r9-extended-floating-point-types-and-standard-names/70033/22, this commit enhances the handling of the __bf16 type in Clang. - Firstly, it upgrades __bf16 from a storage-only type to an arithmetic type. - Secondly, it changes the mangling of __bf16 to DF16b on all architectures except ARM. This change has been made in accordance with the finalization of the mangling for the std::bfloat16_t type, as discussed at https://github.com/itanium-cxx-abi/cxx-abi/pull/147. - Finally, this commit extends the existing excess precision support to the __bf16 type. This applies to hardware architectures that do not natively support bfloat16 arithmetic. Appropriate tests have been added to verify the effects of these changes and ensure no regressions in other areas of the compiler. Reviewed By: rjmccall, pengfei, zahiraam Differential Revision: https://reviews.llvm.org/D150913
2023-04-28[RISCV] Add attribute(riscv_rvv_vector_bits(N)) based on AArch64 ↵Craig Topper1-0/+13
arm_sve_vector_bits. This allows the user to set the size of the scalable vector so they can be used in structs and as the type of global variables. This works by representing the type as a fixed vector instead of a scalable vector in IR. Conversions to and from scalable vectors are made where necessary like function arguments/returns and intrinsics. This features has been requested here https://github.com/riscv-non-isa/rvv-intrinsic-doc/issues/176 I know arm_sve_vector_bits is used by the Eigen library so this could be used to port Eigen to RVV. This patch adds a new preprocessor define `__riscv_v_fixed_vlen` that is set when -mrvv_vector_bits is passed on the command line. The code is largely based on the AArch64 code. A lot of code was copy/pasted and then modiied to RVV. There may be some opportunities for sharing. This first patch only supports the LMUL=1 types. Additional changes will be needed to support other LMULs. I have also not supported mask vectors. Differential Revision: https://reviews.llvm.org/D145088
2023-04-21Revert "[clang] trigger -Wcast-qual on functional casts"Aaron Ballman1-3/+0
This reverts commit 7c0021923503a9a5fe1ba1f0b778b5b83c42aa43. It broke post-commit buildbots: https://lab.llvm.org/buildbot/#/builders/37/builds/21631
2023-04-21[clang] trigger -Wcast-qual on functional castsJorge Pinto Sousa1-0/+3
-Wcast-qual does not trigger on the following code in Clang, but does in GCC. const auto i = 42; using T = int*; auto p = T(&i); The expected behavior is that a functional cast should trigger the warning the same as the equivalent C cast because the meaning is the same, and nothing about the functional cast makes it easier to recognize that a const_cast is occurring. Fixes https://github.com/llvm/llvm-project/issues/62083 Differential Revision: https://reviews.llvm.org/D148276
2023-04-20[C11] Allow casting to an _Atomic-qualified typeAaron Ballman1-1/+5
We were failing to strip off atomic qualification when forming the cast destination type, but properly stripping off cvr qualification. Now we accept atomic, qualified, or unqualified destination types. Note: the semantics of the cast still drop the qualifier, so such a cast does not result in an atomic rvalue. Fixes https://github.com/llvm/llvm-project/issues/39596