[clang] fa2302d - [clang][Sema] Add regression test for #46331 (#226722)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 26 01:02:02 PST 2026
Author: pb01ka
Date: 2026-11-26T09:01:55Z
New Revision: fa2302dee7918455f5761ec2483019118b048fee
URL: https://github.com/llvm/llvm-project/commit/fa2302dee7918455f5761ec2483019118b048fee
DIFF: https://github.com/llvm/llvm-project/commit/fa2302dee7918455f5761ec2483019118b048fee.diff
LOG: [clang][Sema] Add regression test for #46331 (#226722)
Added a regression test in for #46331 which has been fixed since e84e4b6fedb5a643082cd38d0e10d910b299f73f.
Closes https://github.com/llvm/llvm-project/issues/46331
Added:
Modified:
clang/test/SemaCXX/deduced-return-type-cxx14.cpp
Removed:
################################################################################
diff --git a/clang/test/SemaCXX/deduced-return-type-cxx14.cpp b/clang/test/SemaCXX/deduced-return-type-cxx14.cpp
index 10ea9e82f5327f..f91335a76feac8 100644
--- a/clang/test/SemaCXX/deduced-return-type-cxx14.cpp
+++ b/clang/test/SemaCXX/deduced-return-type-cxx14.cpp
@@ -792,3 +792,10 @@ auto f() {
return c;
}
}
+
+namespace GH46331 {
+template <typename> alignas (enum a{}) // expected-error {{cannot be defined in a type specifier}}
+~a ()()() -> auto; // expected-error {{function with trailing return type must specify return type 'auto', not 'void'}} \
+ // expected-error {{destructor must be a non-static member function}} \
+ // expected-error {{destructor cannot be declared as a template}}
+}
More information about the cfe-commits
mailing list