[PATCH] D38483: [ExprConstant] Allow constexpr ctor to modify non static data members in body
Erik Pilkington via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 3 08:00:44 PDT 2017
erik.pilkington added inline comments.
================
Comment at: lib/AST/ExprConstant.cpp:588
+ : EI(EI), Object(Object) {
+ DidInsert = EI.EvaluatingConstructors.insert(Object).second;
+ }
----------------
rsmith wrote:
> Can the `DidInsert == false` case actually happen?
Yep, if you have the following:
```
struct Outer {
struct Inner {
constexpr Inner() {}
};
Inner i;
constexpr Outer() {}
};
constexpr Outer o;
```
There are two ctor calls for the LValueBase `constexpr Outer o;` at call index 0.
https://reviews.llvm.org/D38483
More information about the cfe-commits
mailing list