[PR c++/82710] false positive paren warning

Nathan Sidwell nathan@acm.org
Fri Nov 3 13:14:00 GMT 2017


On 11/02/2017 02:24 PM, Nathan Sidwell wrote:
> This patch fixes pr82710, were we erroneously warn on something like:
>     friend class_X (::other::name (...));
> the parens are needed, otherwise the '::other' is taken to be a 
> qualified lookup inside the class_X.
> 
> Unfortunately, at the point we can check, we've lost information that 
> '::' was used.  So I back off when we see a qualified name there.

I realized CLASS_TYPE_P was overly restrictive.  There are other 
class-like entities that also need protection (typename_types etc). 
Fixed with this patch that uses MAYBE_CLASS_TYPE and ENUMERAL_TYPE.  I 
pushed this test to the end, as it is more complicated, so we'll only 
get to it after we know we have a qualified name.

nathan

-- 
Nathan Sidwell
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 82710-2.diff
Type: text/x-patch
Size: 2592 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20171103/a4ba31d6/attachment.bin>


More information about the Gcc-patches mailing list