Skip to content

Commit 895924e

Browse files
committed
Add comment
1 parent 5143d71 commit 895924e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

clang/include/clang/Basic/Diagnostic.td

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,23 @@ multiclass CXXCompat<
180180
DefaultIgnore;
181181
}
182182

183+
// These generate pairs of C++ compatibility warnings of the form:
184+
//
185+
// - compat_cxx<std>_<name>
186+
// - compat_pre_cxx<std>_<name>
187+
//
188+
// The 'compat_cxx...' warning is intended to be issued in C++<std> mode,
189+
// and the 'compat_pre_cxx...' warning in C++ modes before C++<std>.
190+
//
191+
// Example:
192+
//
193+
// defm inline_variable : CXX17Compat<"inline variables are">;
194+
//
195+
// This generates two warnings:
196+
//
197+
// - compat_cxx17_inline_variable: 'inline variables are incompatible with C++ standards before C++17'
198+
// - compat_pre_cxx17_inline_variable: 'inline variables are a C++17 extension'
199+
//
183200
multiclass CXX11Compat<string message, bit ext_warn = true> : CXXCompat<message, 11, ext_warn>;
184201
multiclass CXX14Compat<string message, bit ext_warn = true> : CXXCompat<message, 14, ext_warn>;
185202
multiclass CXX17Compat<string message, bit ext_warn = true> : CXXCompat<message, 17, ext_warn>;

0 commit comments

Comments
 (0)