C++ 20 template id issue

  c++, gcc

I have this code that is compiling well using std=c++7.

Now after migrating to c++20.

I got an error.

template<typename T>
struct S {
   S<T>(){};
};
error expected unqualified-id before ')' token line 3

Is there a solution to avoid this issue without modifying the code because it belongs to an external lib ?

PS: gcc 11.1 is reporting the issue but not clang !!!

Source: Windows Questions C++

LEAVE A COMMENT