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

Allen zhong <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|INVALID                     |---
             Status|RESOLVED                    |REOPENED

--- Comment #5 from Allen zhong <[email protected]> ---
I reopen it as it is undefined behavior, see detail in the link

https://isocpp.org/wiki/faq/const-correctness#mutable-data-members

Please don't write saying version X of compiler Y on machine Z lets you change
a non-mutable member of a const object. I don’t care - it is illegal according
to the language and your code will probably fail on a different compiler or
even a different version (an upgrade) of the same compiler. Just say no. Use
mutable instead. Write code that is guaranteed to work, not code that doesn't
seem to break

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to