* constexpr.c (build_data_member_initialization): Ignore
initialization of a local variable.
From-SVN: r245410
+2017-02-13 Jason Merrill <jason@redhat.com>
+
+ PR c++/79461 - ICE with lambda in constexpr constructor
+ * constexpr.c (build_data_member_initialization): Ignore
+ initialization of a local variable.
+
2017-02-13 Jakub Jelinek <jakub@redhat.com>
* init.c (warn_placement_new_too_small): Add missing space in
if (TREE_CODE (member) == COMPONENT_REF)
{
tree aggr = TREE_OPERAND (member, 0);
+ if (TREE_CODE (aggr) == VAR_DECL)
+ /* Initializing a local variable, don't add anything. */
+ return true;
if (TREE_CODE (aggr) != COMPONENT_REF)
/* Normal member initialization. */
member = TREE_OPERAND (member, 1);
--- /dev/null
+// PR c++/79461
+// { dg-options -std=c++1z }
+
+struct S {
+ constexpr S(int i) {
+ auto f = [i]{};
+ }
+};
+int main() {}
+