[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaCXX / crash-lambda-weak-attr.cpp
blobc3866930092ffcf95c210eaa5b88a401be9c4335
1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++17 %s
3 struct Weak {
4 [[gnu::weak]]void weak_method();
5 };
6 static_assert([](){ return &Weak::weak_method != nullptr; }()); // expected-error {{static assertion expression is not an integral constant expression}} \
7 // expected-note {{comparison against pointer to weak member 'Weak::weak_method' can only be performed at runtime}} \
8 // expected-note {{in call to}}