[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Parser / cxx2c-variadic-friends-ext-diags.cpp
blobffcc97ffd635298b1ec83a75a027b8aa601a75d7
1 // RUN: %clang_cc1 -std=c++2c -verify=compat -fsyntax-only -Wpre-c++26-compat %s
2 // RUN: %clang_cc1 -std=c++11 -verify=pre2c -fsyntax-only -Wc++26-extensions %s
4 struct S {
5 friend int, long, char; // compat-warning {{variadic 'friend' declarations are incompatible with C++ standards before C++2c}} \
6 // pre2c-warning {{variadic 'friend' declarations are a C++2c extension}}
7 };
9 template <typename ...Types>
10 struct TS {
11 friend Types...; // compat-warning {{variadic 'friend' declarations are incompatible with C++ standards before C++2c}} \
12 // pre2c-warning {{variadic 'friend' declarations are a C++2c extension}}
14 friend int, Types..., Types...; // compat-warning {{variadic 'friend' declarations are incompatible with C++ standards before C++2c}} \
15 // pre2c-warning {{variadic 'friend' declarations are a C++2c extension}}