[clang] 111c1ba - [NFC][Clang] Fix test constexpr-function-recovery-crash.cpp (#65269)

via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 5 08:21:48 PDT 2023


Author: yronglin
Date: 2023-09-05T23:21:44+08:00
New Revision: 111c1ba5b492bd4bf64dfccc675a9db32ff6a28a

URL: https://github.com/llvm/llvm-project/commit/111c1ba5b492bd4bf64dfccc675a9db32ff6a28a
DIFF: https://github.com/llvm/llvm-project/commit/111c1ba5b492bd4bf64dfccc675a9db32ff6a28a.diff

LOG: [NFC][Clang] Fix test constexpr-function-recovery-crash.cpp (#65269)

Signed-off-by: yronglin <yronglin777 at gmail.com>

Added: 
    

Modified: 
    clang/test/SemaCXX/constexpr-function-recovery-crash.cpp

Removed: 
    


################################################################################
diff  --git a/clang/test/SemaCXX/constexpr-function-recovery-crash.cpp b/clang/test/SemaCXX/constexpr-function-recovery-crash.cpp
index 16654104a9177ef..e1d97ceafbe9d15 100644
--- a/clang/test/SemaCXX/constexpr-function-recovery-crash.cpp
+++ b/clang/test/SemaCXX/constexpr-function-recovery-crash.cpp
@@ -99,6 +99,10 @@ TEST_EVALUATE(DoWhileCond, do {} while (some_cond < 10););    // expected-error
                                                               // expected-error {{constexpr variable 'forceEvaluateDoWhileCond' must be initialized by a constant expression}}
 TEST_EVALUATE(If, if (!!){};);                // expected-error + {{}}
 TEST_EVALUATE(IfInit, if (auto x = !!; 1){};);// expected-error + {{}}
-TEST_EVALUATE(ForInit, if (!!;;){};);         // expected-error + {{}}
-TEST_EVALUATE(ForCond, if (; !!;){};);        // expected-error + {{}}
-TEST_EVALUATE(ForInc, if (;; !!){};);         // expected-error + {{}}
+TEST_EVALUATE(ForInit, for (!!;;){};);// expected-error + {{}}
+                                      // expected-note at -1 + {{infinite loop}}
+                                      // expected-note at -2 {{in call}}
+TEST_EVALUATE(ForCond, for (; !!;){};);// expected-error + {{}}
+TEST_EVALUATE(ForInc, for (;; !!){};);// expected-error + {{}}
+                                      // expected-note at -1 + {{infinite loop}}
+                                      // expected-note at -2 {{in call}}


        


More information about the cfe-commits mailing list