[Bug c++/107118] New: "does not name a type" when used in constrained struct specialization
lhlaurini at hotmail dot com
gcc-bugzilla@gcc.gnu.org
Sun Oct 2 05:10:29 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107118
Bug ID: 107118
Summary: "does not name a type" when used in constrained struct
specialization
Product: gcc
Version: 12.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: lhlaurini at hotmail dot com
Target Milestone: ---
This is similar to bug 92944. The following code fails to compile:
namespace N { template <class T> struct Q; struct S; }
template <class T> requires false struct N::Q<T> { S& x; };
template <class T> requires true struct N::Q<T> { S& x; };
with
<source>:3:52: error: 'S' does not name a type
3 | template <class T> requires false struct N::Q<T> { S& x; };
| ^
If I change it to:
namespace N { template <class T> struct Q; struct S; }
template <class T> requires false struct N::Q<T> { S& x; };
template <class T> requires true struct N::Q<T> { N::S& x; };
then it works.
Tested locally on GCC 12.2.0 and on https://godbolt.org/z/M7rEEb1Y1.
More information about the Gcc-bugs
mailing list