I think the parser approach is more correct.

On 06/09/2014 07:02 PM, Paolo Carlini wrote:
                             !TYPE_WAS_ANONYMOUS (class_type)
+                            && !friend_p
                             && constructor_name_p (unqualified_name,
                                                    class_type))

But here you also need to check qualifying_scope; 'friend' does not affect whether or not a qualified-id is a constructor.

+                                       friend_p
+                                       /* With -fpermissive we want to accept:

+                                          struct S {
+                                            struct T{};
+                                            friend S::S(T);
+                                          };
+
+                                          thus also check the return type
+                                          to do the right thing later in
+                                          cp_parser_direct_declarator.  */
+                                       && decl_specifiers.type);

And then you don't need to consider decl_specifiers.type here.

Jason

Reply via email to