[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaCXX / pr50497-crash-typeid.cpp
blob3ae61e8279eb3bb59d1b26309ed3cf1070257b67
1 // RUN: %clang_cc1 -verify %s -Wno-unevaluated-expression
2 // Don't crash (PR50497).
4 // expected-no-diagnostics
5 namespace std {
6 class type_info;
9 class Ex {
10 // polymorphic
11 virtual ~Ex();
13 void Frob(const std::type_info &type);
15 void Foo(Ex *ex) {
16 // generic lambda
17 [=](auto rate) {
18 // typeid
19 Frob(typeid(*ex));
20 }(1);
22 [=](auto rate) {
23 // unevaluated nested typeid
24 Frob(typeid((typeid(*ex), ex)));
25 }(1);