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 59571


Hi,

noticed this issue, which looks simple to fix. The ICE happens in cxx_eval_constant_expression, because it cannot handle a CAST_EXPR (or any othe *_CAST, for that matter). In fact check_narrowing calls maybe_constant_value, and, because we are in a template, the latter faces the unfolded CAST_EXPR. Thus it seems easy to just use fold_non_dependent_expr_sfinae. Tested x86_64-linux.

Thanks,
Paolo.

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

PS: looking forward, I'm wondering if some semantics/typeck functions shouldn't try harder before building a tree node and returning, eg, instead of just checking processing_template_decl, actually checking if type and expr are dependent? Does this kind of audit make sense for next Stage 1?

Attachment: CL_59571
Description: Text document

Attachment: patch_59571
Description: Text document


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