This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[C++ Patch] PR 39970


Hi,

I'm trying to resolve this rather old PR, where we don't reject uses of the dot operator in default template arguments, eg:

class blah { int member; };
blah global;

template<int param = global.member>
class template_blah;


I'm enforcing the check by adding to cp_parser a new in_template_default_argument_p which can be set in cp_parser_default_argument. Then it's just matter of reading it (together with integral_constant_expression_p, otherwise we can make mistakes in the argument of eg, sizeof or decltype) exactly when parsing . -> .* and ->* in order to have a precise location for the error. Is this the way we can fix this or we can do better?


Tested x86_64-linux.

Thanks,
Paolo.

//////////////////////////////

Attachment: CL_39970
Description: Text document

Attachment: patch_39970
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]