================
@@ -0,0 +1,47 @@
+
+//===-- TestLanguage.def - Language Versions for Testing --------*- C++ 
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// The TESTLANGUAGE(-C/-CXX) macros have four parameters:
+// the language, the standard version, the corresponding compile-flag,
+// and an index of the language version for each language.
+// The standard version is used to compare a standard version numerically,
+// and the index is used to impose ordering for the language versions
+// with respect to each language.
+
+#ifndef TESTLANGUAGE
+#error "TESTLANGUAGE must be defined before including this file"
+#endif
+
+#ifndef TESTLANGUAGE_C
+#define TESTLANGUAGE_C TESTLANGUAGE
+#endif
+
+#ifndef TESTLANGUAGE_CXX
+#define TESTLANGUAGE_CXX TESTLANGUAGE
+#endif
----------------
Sirraide wrote:

```suggestion
#ifndef TESTLANGUAGE
#  define TESTLANGUAGE(...)
#endif

#ifndef TESTLANGUAGE_C
#  define TESTLANGUAGE_C(...) TESTLANGUAGE(__VA_ARGS__)
#endif

#ifndef TESTLANGUAGE_CXX
#  define TESTLANGUAGE_CXX(...) TESTLANGUAGE(__VA_ARGS__)
#endif
```

This would be more consistent with what we do elsewhere (e.g. `StmtNodes.inc`) 
and would make using this easier since you can now just define the one you care 
about instead of having to potentially define all three of them.

https://github.com/llvm/llvm-project/pull/94243
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to