[clang] 47e7bdb - Test that would have caught recovery-expr crashes in 0788acbccbec. NFC

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 26 10:43:43 PDT 2020


Author: Sam McCall
Date: 2020-03-26T18:43:29+01:00
New Revision: 47e7bdb10732e6f140adce39a1bc34e3ee2a6ea6

URL: https://github.com/llvm/llvm-project/commit/47e7bdb10732e6f140adce39a1bc34e3ee2a6ea6
DIFF: https://github.com/llvm/llvm-project/commit/47e7bdb10732e6f140adce39a1bc34e3ee2a6ea6.diff

LOG: Test that would have caught recovery-expr crashes in 0788acbccbec. NFC

Added: 
    clang/test/Sema/invalid-member.cpp

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/clang/test/Sema/invalid-member.cpp b/clang/test/Sema/invalid-member.cpp
new file mode 100644
index 000000000000..5475157e936e
--- /dev/null
+++ b/clang/test/Sema/invalid-member.cpp
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -verify -fsyntax-only %s
+void foo(); // expected-note {{requires 0 arguments}}
+class X {
+  decltype(foo(42)) invalid; // expected-error {{no matching function}}
+};
+// Should be able to evaluate sizeof without crashing.
+static_assert(sizeof(X) == 1, "No valid members");


        


More information about the cfe-commits mailing list