[llvm-bugs] [Bug 46499] static constepxr members of arguments passed by reference are not recognised as constexpr

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 29 09:29:05 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=46499

Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #2 from Richard Smith <richard-llvm at metafoo.co.uk> ---
I believe clang is following the language rules here. You can't mention a
reference from a constant expression unless we know the object the reference
binds to, because the evaluation semantics of an lvalue include determining the
object it denotes.

As far as I can tell, other compilers sometimes accept this because they do
some kind of early AST folding that loses the distinction between a direct
access to a static data member and a class member access.

*** This bug has been marked as a duplicate of bug 41093 ***

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200629/7323ad5b/attachment-0001.html>


More information about the llvm-bugs mailing list