[clang] [clang] NFC: Add test case for #178324 and mark it as fixed (PR #190490)
Matheus Izvekov via cfe-commits
cfe-commits at lists.llvm.org
Sat Apr 4 14:13:08 PDT 2026
https://github.com/mizvekov created https://github.com/llvm/llvm-project/pull/190490
Issue #178324 was actually fixed by #187755
We lost the "declaration does not declare anything" warning since the regression was introduced, but that was because:
1) Since #78436 we treat __builtin_FUNCSIG in a dependent context effectivelly as
if it contained a template parameter.
2) Our decltype implementation treats eexpressions containing template
parameters as if they were completely opaque (but alas this goes against
the spec, which says in [temp.type]p4 this should be looking only
at type dependence).
3) Since the decltype is opaque, we don't know what lookup will find,
so we can't issue the warning because we don't know if we are going
to end up with a type or an expression.
Fixes #178324
>From 1a728084341cf0515e517931cdccdcc099c7322f Mon Sep 17 00:00:00 2001
From: Matheus Izvekov <mizvekov at gmail.com>
Date: Sat, 4 Apr 2026 17:57:15 -0300
Subject: [PATCH] [clang] NFC: Add test case for #178324 and mark it as fixed
Issue #178324 was actually fixed by #187755
We lost the "declaration does not declare anything" warning since
the regression was introduced, but that was because:
1) Since #78436 we treat __builtin_FUNCSIG in a dependent context effectivelly as
if it contained a template parameter.
2) Our decltype implementation treats eexpressions containing template
parameters as if they were completely opaque (but alas this goes against
the spec, which says in [temp.type]p4 this should be looking only
at type dependence).
3) Since the decltype is opaque, we don't know what lookup will find,
so we can't issue the warning because we don't know if we are going
to end up with a type or an expression.
Fixes #178324
---
clang/test/SemaCXX/source_location.cpp | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/clang/test/SemaCXX/source_location.cpp b/clang/test/SemaCXX/source_location.cpp
index c8b65d6eab50d..eaa6cb04c5d1c 100644
--- a/clang/test/SemaCXX/source_location.cpp
+++ b/clang/test/SemaCXX/source_location.cpp
@@ -1081,3 +1081,13 @@ static_assert(X{}.
static_assert(X{}.
foo() == 10001);
}
+
+#ifdef MS
+namespace GH178324 {
+ struct a {
+ using e = int;
+ };
+ void current(const char * = __builtin_FUNCSIG());
+ template <class> void c() { decltype(a(current()))::e; }
+} // namespace GH178324
+#endif
More information about the cfe-commits
mailing list