In C++14 onwards, it is permitted to read mutable members in constant
authorRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 21 Feb 2018 03:38:30 +0000 (03:38 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 21 Feb 2018 03:38:30 +0000 (03:38 +0000)
commit9defb7d6b14df6db702da51ed03a8586fe8c060e
treea1a948620ee62e0b9786d4804da9b27e0bb3c577
parent63a1098d73312c89a538d67aa2cf1188513bcc83
In C++14 onwards, it is permitted to read mutable members in constant
expressions, if their lifetime began during the evaluation of the expression.

This is technically not allowed in C++11, though we could consider permitting
it there too, as an extension.

llvm-svn: 325663
clang/lib/AST/ExprConstant.cpp
clang/test/SemaCXX/constant-expression-cxx1y.cpp