llvm-project/clang/test/CodeCompletion/objc-cast-parenthesized-expr.m
edisongz 8988fb7516
[clang][ObjC][CodeComplete] Fix crash on C-Style cast with parenthesized operand in ObjC++ (#180343)
In ObjC++ mode, code-completion after a C-style cast like
`(int*)(0x200)` crashed because the inner parenthesized expression was
parsed as a `ParenListExpr` (null type) due to `AllowTypes` propagation.

Fixes https://github.com/llvm/llvm-project/issues/180125
2026-02-15 15:30:03 -08:00

13 lines
397 B
Objective-C

// Note: the run lines follow their respective tests, since line/column
// matter in this test.
void func() {
int *foo = (int *)(0x200);
int *bar = (int *)((0x200));
}
// Make sure this doesn't crash
// RUN: %clang_cc1 -fsyntax-only -xobjective-c++-header -code-completion-at=%s:%(line-5):28 %s
// RUN: %clang_cc1 -fsyntax-only -xobjective-c++-header -code-completion-at=%s:%(line-5):30 %s