Files
TheRock/compiler/amd-llvm/clang/test/Analysis/anonymous-decls.cpp
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

88 lines
3.1 KiB
C++

// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG -triple x86_64-apple-darwin12 -std=c++20 %s 2>&1 | FileCheck %s
struct A {
static A a;
char b;
friend bool operator==(A, A) = default;
};
bool _ = A() == A::a;
// FIXME: steps 1 and 5 show anonymous function parameters are
// not handled correctly.
// CHECK-LABEL: bool operator==(A, A) noexcept = default
// CHECK-NEXT: [B2 (ENTRY)]
// CHECK-NEXT: Succs (1): B1
// CHECK: [B1]
// CHECK-NEXT: 1: function-parameter-0-0
// CHECK-NEXT: 2: [B1.1].b
// CHECK-NEXT: 3: [B1.2] (ImplicitCastExpr, LValueToRValue, char)
// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, IntegralCast, int)
// CHECK-NEXT: 5: function-parameter-0-1
// CHECK-NEXT: 6: [B1.5].b
// CHECK-NEXT: 7: [B1.6] (ImplicitCastExpr, LValueToRValue, char)
// CHECK-NEXT: 8: [B1.7] (ImplicitCastExpr, IntegralCast, int)
// CHECK-NEXT: 9: [B1.4] == [B1.8]
// CHECK-NEXT: 10: return [B1.9];
// CHECK-NEXT: Preds (1): B2
// CHECK-NEXT: Succs (1): B0
// CHECK: [B0 (EXIT)]
// CHECK-NEXT: Preds (1): B1
namespace std {
template <class> struct iterator_traits;
template <class, class> struct pair;
template <class _Tp> struct iterator_traits<_Tp *> {
typedef _Tp &reference;
};
template <long, class> struct tuple_element;
template <class> struct tuple_size;
template <class _T1, class _T2> struct tuple_size<pair<_T1, _T2>> {
static const int value = 2;
};
template <class _T1, class _T2> struct tuple_element<0, pair<_T1, _T2>> {
using type = _T1;
};
template <class _T1, class _T2> struct tuple_element<1, pair<_T1, _T2>> {
using type = _T2;
};
template <long _Ip, class _T1, class _T2>
tuple_element<_Ip, pair<_T1, _T2>>::type get(pair<_T1, _T2> &);
struct __wrap_iter {
iterator_traits<pair<int, int> *>::reference operator*();
void operator++();
};
bool operator!=(__wrap_iter, __wrap_iter);
struct vector {
__wrap_iter begin();
__wrap_iter end();
};
} // namespace std
int main() {
std::vector v;
for (auto &[a, b] : v)
;
}
// FIXME: On steps 8 and 14, a decomposition is referred by name, which they never have.
// CHECK-LABEL: int main()
// CHECK: [B3]
// CHECK-NEXT: 1: operator*
// CHECK-NEXT: 2: [B3.1] (ImplicitCastExpr, FunctionToPointerDecay, iterator_traits<pair<int, int> *>::reference (*)(void))
// CHECK-NEXT: 3: __begin1
// CHECK-NEXT: 4: * [B3.3] (OperatorCall)
// CHECK-NEXT: 5: auto &;
// CHECK-NEXT: 6: get<0UL>
// CHECK-NEXT: 7: [B3.6] (ImplicitCastExpr, FunctionToPointerDecay, tuple_element<0L, pair<int, int> >::type (*)(pair<int, int> &))
// CHECK-NEXT: 8: decomposition-a-b
// CHECK-NEXT: 9: [B3.7]([B3.8])
// CHECK-NEXT: 10: std::tuple_element<0UL, std::pair<int, int>>::type a = get<0UL>(decomposition-a-b);
// CHECK-NEXT: 11: get<1UL>
// CHECK-NEXT: 12: [B3.11] (ImplicitCastExpr, FunctionToPointerDecay, tuple_element<1L, pair<int, int> >::type (*)(pair<int, int> &))
// CHECK-NEXT: 13: decomposition-a-b
// CHECK-NEXT: 14: [B3.12]([B3.13])
// CHECK-NEXT: 15: std::tuple_element<1UL, std::pair<int, int>>::type b = get<1UL>(decomposition-a-b);
// CHECK-NEXT: Preds (1): B1
// CHECK-NEXT: Succs (1): B2