[cfe-dev] static_assert : expression is not an integral constant expression

Keane, Erich via cfe-dev cfe-dev at lists.llvm.org
Mon Jun 1 07:37:05 PDT 2020


Clang appears to be correct here, parameters in a constexpr function are not themselves constexpr.  SO, accessing ‘data’ isn’t legal.  I don’t know why the other compilers wouldn’t diagnose this.

I presume you’re getting this from a case where TrivialOutputMessage’s constructor takes a template parameter (and you’ve over-reduced), but you’d want to do something more like this : https://godbolt.org/z/uBSWt5


From: cfe-dev <cfe-dev-bounces at lists.llvm.org> On Behalf Of Umesh Kalappa via cfe-dev
Sent: Monday, June 1, 2020 7:27 AM
To: cfe-dev at lists.llvm.org Developers <cfe-dev at lists.llvm.org>
Subject: [cfe-dev] static_assert : expression is not an integral constant expression

Hi Everyone,

For the below sample,

https://godbolt.org/z/zugh_5

Clang popping up with an error , not the GCC or any other compiler out there.

For us, it looks like a frontend issue, that needs a fix.

Thank you
~Umesh

[https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free. www.avast.com<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200601/abd4c76b/attachment.html>


More information about the cfe-dev mailing list