On 6/3/19 9:01 PM, Marek Polacek wrote:
I sort of ended up going down a rathole, but then I realized we don't need to
delay parsing of noexcept-specifiers of member friend function declarations,
because they aren't members of the class.
Where are you getting this from? I'm definitely sympathetic to the idea
that noexcept-specifiers of friend functions shouldn't need to be
complete-class contexts, but 10.3 doesn't make that distinction that I
can see.
This was a huge relief because
member friend function declarations can be redeclared, so we'd have to make
sure to check if their noexcept-specifiers match. But member function decls
can't be redeclared. I updated the comment to better reflect why what I'm
doing there is correct, along with an assert.
But then why do you still need this:
+ /* We can't compare unparsed noexcept-specifiers. Save the decl
+ and check this again after we've parsed the noexcept-specifiers
+ for real. */
+ if (UNPARSED_NOEXCEPT_SPEC_P (new_exceptions))
+ {
+ DEFARG_DECL (TREE_PURPOSE (new_exceptions)) = copy_decl (old_decl);
+ return;
+ }
?
Jason