llvm-project/clang/test/AST/ast-crash-dump-mangled-name-json.m
Aaron Ballman c5bf901b1b
Fix crash with -ast-dump=json (#137324)
When given an invalid Objective-C extension, Clang would crash when
trying to emit the mangled name of the method to the JSON dump output.

Fixes #137320
2025-04-29 07:55:32 -04:00

15 lines
445 B
Objective-C

// RUN: not %clang_cc1 -ast-dump=json %s 2>&1 | FileCheck %s
// Ensure that dumping this does not crash when emitting the mangled name.
// See GH137320 for details.
// Note, this file does not compile and so we also check the error.
@interface SomeClass (SomeExtension)
+ (void)someMethod;
@end
// CHECK: error: cannot find interface declaration for 'SomeClass'
// CHECK: "name": "someMethod"
// CHECK-NEXT: "mangledName": "+[ someMethod]",