1 // RUN: clang-tblgen -gen-clang-diags-defs -I%S %s -o - 2>&1 | \
2 // RUN: FileCheck --strict-whitespace %s
3 include "DiagnosticBase.inc"
5 // Test usage of Deferrable and NonDeferrable in diagnostics.
7 def test_default : Error<"this error is non-deferrable by default">;
8 // CHECK-DAG: DIAG(test_default, {{.*}}SFINAE_SubstitutionFailure, false, true, true, false, 0)
10 def test_deferrable : Error<"this error is deferrable">, Deferrable;
11 // CHECK-DAG: DIAG(test_deferrable, {{.*}} SFINAE_SubstitutionFailure, false, true, true, true, 0)
13 def test_non_deferrable : Error<"this error is non-deferrable">, NonDeferrable;
14 // CHECK-DAG: DIAG(test_non_deferrable, {{.*}} SFINAE_SubstitutionFailure, false, true, true, false, 0)
16 let Deferrable = 1 in {
18 def test_let : Error<"this error is deferrable by let">;
19 // CHECK-DAG: DIAG(test_let, {{.*}} SFINAE_SubstitutionFailure, false, true, true, true, 0)
21 // Make sure TextSubstitution is allowed in the let Deferrable block.
22 def textsub : TextSubstitution<"%select{text1|text2}0">;
24 def test_let2 : Error<"this error is deferrable by let %sub{textsub}0">;
25 // CHECK-DAG: DIAG(test_let2, {{.*}} SFINAE_SubstitutionFailure, false, true, true, true, 0)