[Bug c++/96111] checking type of attribute with concepts results in compilation error or ICE
lts-rudolph at gmx dot de
gcc-bugzilla@gcc.gnu.org
Wed Jul 8 12:37:12 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96111
--- Comment #1 from Klaus Rudolph <lts-rudolph at gmx dot de> ---
The error massages are valid as
as got by an answr on SO (
https://stackoverflow.com/questions/62791460/checking-type-of-attribute-with-concepts
)
[expr.prim.req.compound]/1.3
If the return-type-requirement is present, then:
Substitution of template arguments (if any) into the
return-type-requirement is performed.
The immediately-declared constraint ([temp.param]) of the
type-constraint for decltype((E)) shall be satisfied.
E is our expression, namely n.value.
Now, decltype(n.value) is char or int, that's because decltype has a special
rule for class member access and id expressions. But decltype((n.value)) is
char& or int&. The value category is encoded in the type of decltype when
dealing with a general expression (such as a parenthesized class member
access).
BUT: That we see an ICE on current trunk is a bug!
More information about the Gcc-bugs
mailing list