clang/test/SemaCXX/crash-GH121274.cpp
raw| 1 | // RUN: %clang_cc1 -std=c++11 -verify %s |
| 2 | // expected-no-diagnostics |
| 3 | |
| 4 | // Do not crash when __PRETTY_FUNCTION__ appears in the trailing return type of the lambda |
| 5 | void foo() { |
| 6 | []() -> decltype(static_cast<const char*>(__PRETTY_FUNCTION__)) { |
| 7 | return nullptr; |
| 8 | }(); |
| 9 | |
| 10 | #ifdef MS |
| 11 | []() -> decltype(static_cast<const char*>(__FUNCSIG__)) { |
| 12 | return nullptr; |
| 13 | }(); |
| 14 | #endif |
| 15 | } |