Files
llvm-project/lldb/test/Shell/Expr/TestExprLanguageNote_NoDebug.cpp
Michael Buch 26ff166637 [lldb][ClangExpressionParser] Emit more accurate language note for Objective-C++ fallback (#172047)
We fall back to `Objective-C++` when running C++ expressions in frames
that don't have debug-info. But we were missing a fallback note for this
situation. We would now print following note on expression error:
```
note: Possibly stopped inside system library, so speculatively enabled Objective-C. Ran expression as 'Objective C++'.
```
2025-12-12 17:42:58 +00:00

20 lines
533 B
C++

// REQUIRES: system-darwin
//
// Tests the language fall back diagnostic for when we fall back to
// Objective-C++ when stopped in frames with no debug-info.
//
// RUN: %clangxx_host %s -o %t.out
//
// RUN: %lldb %t.out \
// RUN: -o "b main" \
// RUN: -o run \
// RUN: -o "expr --language c++ -- blah" -o quit 2>&1 | FileCheck %s
// CHECK: (lldb) expr
// CHECK: note: Possibly stopped inside system library, so speculatively enabled Objective-C. Ran expression as 'Objective C++'.
int main() {
int x = 10;
return x;
}