[Bug c++/111113] Cannot define friend function of a local class in namespace scope

2023-08-23 Thread language.lawyer at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=13

Language Lawyer  changed:

   What|Removed |Added

 CC||language.lawyer at gmail dot 
com

--- Comment #5 from Language Lawyer  ---
(In reply to Andrew Pinski from comment #3)
> I think this is a dup of bug 101356.

Looks dup to me too. Looks like GCC does not match friend function declaration
with its namespace declaration.

[Bug c++/69701] "v.operator T()" incorrectly parsed if "v.T()" present.

2022-01-07 Thread language.lawyer at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69701

Language Lawyer  changed:

   What|Removed |Added

 CC||language.lawyer at gmail dot 
com

--- Comment #7 from Language Lawyer  ---
Another example related to CWG2396:

struct B
{
struct S {};
operator S();
}; 

auto v = B{}.operator struct S(); // error: 'struct B' has no member named
'operator S'

It can be checked that GCC injects unrelated `struct S` into the global
namespace and then tries to find `operator struct ::S` in B.

However, according to P1787R6 [basic.lookup.unqual]/5: An unqualified name that
is a component name of a type-specifier or ptr-operator of a conversion-type-id
is looked up in the same fashion as the conversion-function-id in which it
appears.

In an elaborated-type-specifier of the form "class-key identifier", such as
`struct S`, identifier is a component name ([dcl.type.elab]/1), so S shall be
searched in B first.

[Bug c++/51757] friend defined inside class and declared inside main linker error

2021-01-18 Thread language.lawyer at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51757

Language Lawyer  changed:

   What|Removed |Added

 CC||language.lawyer at gmail dot 
com

--- Comment #6 from Language Lawyer  ---
No linker error in GCC 11.0.0 20210117 (experimental)
https://wandbox.org/permlink/EXabQxhTzbDzvbvr