aboutsummaryrefslogtreecommitdiff
path: root/clang/test
diff options
context:
space:
mode:
authorMariya Podchishchaeva <mariya.podchishchaeva@intel.com>2024-03-08 11:52:42 +0300
committerGitHub <noreply@github.com>2024-03-08 09:52:42 +0100
commitdd36138e9c23c462ce5379a3d83530fb4ebec9e7 (patch)
tree57af69b7f0342c5fdf23d5db31c24ffa6757eb75 /clang/test
parent851ab41d33fcbc72bc334dfc2d5d4c0902ccbb23 (diff)
downloadllvm-dd36138e9c23c462ce5379a3d83530fb4ebec9e7.zip
llvm-dd36138e9c23c462ce5379a3d83530fb4ebec9e7.tar.gz
llvm-dd36138e9c23c462ce5379a3d83530fb4ebec9e7.tar.bz2
[clang] Error on explicit specialization of lambda call operator (#84343)
Fixes https://github.com/llvm/llvm-project/issues/83267
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaCXX/lambda-expressions.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/lambda-expressions.cpp b/clang/test/SemaCXX/lambda-expressions.cpp
index 41cf5a4..0516a5d 100644
--- a/clang/test/SemaCXX/lambda-expressions.cpp
+++ b/clang/test/SemaCXX/lambda-expressions.cpp
@@ -732,3 +732,18 @@ void GH67492() {
constexpr auto test = 42;
auto lambda = (test, []() noexcept(true) {});
}
+
+namespace GH83267 {
+auto l = [](auto a) { return 1; };
+using type = decltype(l);
+
+template<>
+auto type::operator()(int a) const { // expected-error{{lambda call operator should not be explicitly specialized or instantiated}}
+ return c; // expected-error {{use of undeclared identifier 'c'}}
+}
+
+auto ll = [](auto a) { return 1; }; // expected-error{{lambda call operator should not be explicitly specialized or instantiated}}
+using t = decltype(ll);
+template auto t::operator()<int>(int a) const; // expected-note {{in instantiation}}
+
+}