From fc1c1dfe77621104eedbd5e738cccf1fe38a2fbd Mon Sep 17 00:00:00 2001 From: "Marco Antonio J. Costa" Date: Mon, 27 Jul 2026 12:06:27 -0300 Subject: [PATCH] remove stray 'typename' before non-qualified names 'typename' disambiguates a qualified dependent name, telling the compiler that something like T::iterator names a type rather than a value. Before a plain identifier there is nothing to disambiguate: P1 is already a type, and so is PopupIndex. The grammar wants a qualified name after the keyword, so clang reports "expected a qualified name after 'typename'", drops the keyword and carries on -- 15175 times, since the offending declarations sit in widely included headers. MSVC accepts them without a word. Semantics do not change. Both compilers already ignored the keyword, so the partial specialisations matched before this and match after it. The diagnostic belongs to no -W group and therefore cannot be switched off with -Wno-, which makes deleting the tokens the only way to quiet it. Co-Authored-By: Claude Opus 5 --- Tactical/LogicalBodyTypes/Singleton.h | 6 +++--- Utils/popup_callback.h | 10 +++++----- Utils/popup_class.h | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Tactical/LogicalBodyTypes/Singleton.h b/Tactical/LogicalBodyTypes/Singleton.h index 948ccc6d8..5c6e9cb17 100644 --- a/Tactical/LogicalBodyTypes/Singleton.h +++ b/Tactical/LogicalBodyTypes/Singleton.h @@ -42,7 +42,7 @@ private : }; -template typename T& Singleton::Instance() { +template T& Singleton::Instance() { if (Singleton::instance_ == 0) { Singleton::instance_ = CreateInstance(); ScheduleForDestruction(Singleton::Destroy); @@ -59,7 +59,7 @@ void Singleton::Destroy() { } template -inline typename T* Singleton::CreateInstance() { +inline T* Singleton::CreateInstance() { return new T(); } @@ -74,6 +74,6 @@ inline void Singleton::DestroyInstance(T* p) { } template -typename T* Singleton::instance_ = 0; +T* Singleton::instance_ = 0; #endif diff --git a/Utils/popup_callback.h b/Utils/popup_callback.h index f38b103e5..025ecc1ff 100644 --- a/Utils/popup_callback.h +++ b/Utils/popup_callback.h @@ -62,7 +62,7 @@ // three params, no return val template - class popupCallbackFunction3: public popupCallback{ + class popupCallbackFunction3: public popupCallback{ protected: void (*fun)(P1,P2,P3); P1 param_1; @@ -144,7 +144,7 @@ // two params, no return val template - class popupCallbackFunction2: public popupCallback{ + class popupCallbackFunction2: public popupCallback{ protected: void (*fun)(P1,P2); P1 param_1; @@ -219,7 +219,7 @@ // no return type, one parameter template - class popupCallbackFunction : public popupCallback{ + class popupCallbackFunction : public popupCallback{ protected: void (*fun)(P1); P1 param_1; @@ -260,7 +260,7 @@ // returns something, no parameter template - class popupCallbackFunction : public popupCallback{ + class popupCallbackFunction : public popupCallback{ protected: R (*fun)(void); public: @@ -337,4 +337,4 @@ }; }; -#endif +#endif diff --git a/Utils/popup_class.h b/Utils/popup_class.h index 9d26ed238..747a22429 100644 --- a/Utils/popup_class.h +++ b/Utils/popup_class.h @@ -44,7 +44,7 @@ UINT32 classId; } PopupIndex ; - extern std::vector gPopupRegionIndex; + extern std::vector gPopupRegionIndex; extern std::vector gPopupIndex; extern UINT32 gPopupRegionIndexCounter;