https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/98563
>From 5cefddec13ca2bafb58a6f714fd2bef435166c8d Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski <sdkryst...@gmail.com> Date: Thu, 11 Jul 2024 18:28:50 -0400 Subject: [PATCH 1/2] [Clang][AST] Don't use canonical type when checking dependence in Type::isOverloadable --- clang/include/clang/AST/Type.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h index a2194361abd53..8b236af78ea22 100644 --- a/clang/include/clang/AST/Type.h +++ b/clang/include/clang/AST/Type.h @@ -8438,7 +8438,7 @@ inline bool Type::isUndeducedType() const { /// Determines whether this is a type for which one can define /// an overloaded operator. inline bool Type::isOverloadableType() const { - if (!CanonicalType->isDependentType()) + if (!isDependentType()) return isRecordType() || isEnumeralType(); return !isArrayType() && !isFunctionType() && !isAnyPointerType() && !isMemberPointerType(); >From 9e89cc489469cd36cb2d853ea6e824567cb820d4 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski <sdkryst...@gmail.com> Date: Mon, 22 Jul 2024 11:39:41 -0400 Subject: [PATCH 2/2] [FOLD] add tests --- clang/test/SemaCXX/dependent-typeof.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 clang/test/SemaCXX/dependent-typeof.cpp diff --git a/clang/test/SemaCXX/dependent-typeof.cpp b/clang/test/SemaCXX/dependent-typeof.cpp new file mode 100644 index 0000000000000..74b107f8e8d55 --- /dev/null +++ b/clang/test/SemaCXX/dependent-typeof.cpp @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +template<bool B> +void f() { + decltype(B) x = false; + __typeof__(B) y = false; + !x; + !y; +} _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits