Open Quuxplusone opened 7 years ago
Attached vla-15-9b115d-e3f212.c
(3462 bytes, text/plain): reproducer source
Attached vla-15-9b115d-e3f212.sh
(1695 bytes, application/x-shellscript): reproducer script
Attached pr31042.zip
(1080 bytes, application/zip): Minimal reproducer
After a short discussion on this in the mailing list:
http://lists.llvm.org/pipermail/cfe-dev/2016-November/051579.html
It seems that the problem is that even though we try to special case typeof,
in order for type of to find if it's evaluated it checks the previous context
(in Sema::TransformToPotentiallyEvaluated). If this previous context is
unevaluated then it does not transform the typeof context. When the typeof is
inside a sizeof context, which is unevaluated, typeof is never transformed and
therefore you can't do a sizeof ( typeof ( <vla> )).
I wonder if it's possible for us to mark sizeof as potentially evaluated
instead? What are the downsides of this?
Created review request https://reviews.llvm.org/D26843
Reproduces on trunk and 4.0, but also on 3.9 so not strictly a regression.
vla-15-9b115d-e3f212.c
(3462 bytes, text/plain)vla-15-9b115d-e3f212.sh
(1695 bytes, application/x-shellscript)pr31042.zip
(1080 bytes, application/zip)