)]}'
{
  "commit": "bdb7fa18765484c2fe97bb6ba9af63682eddb395",
  "tree": "2e2f68748502e1cd04b8999a26b78f783d1fcc40",
  "parents": [
    "4dcdfae29b70074462b10431355015f79bcdb886"
  ],
  "author": {
    "name": "Patrick Palka",
    "email": "ppalka@redhat.com",
    "time": "Fri Jan 30 15:25:43 2026 -0500"
  },
  "committer": {
    "name": "Patrick Palka",
    "email": "ppalka@redhat.com",
    "time": "Mon Mar 02 22:39:46 2026 -0500"
  },
  "message": "c++: non-empty constexpr constructor bodies in C++11 [PR123845]\n\nThis patch makes us support C++14 non-empty constexpr constructor bodies\nin C++11, as an extension.  This will make it trivial to safely fix the\nC++11 library regression PR114865 that requires us to do\n__builtin_clear_padding after initializing _M_i in std::atomic\u0027s\nsingle-parameter constructor, and that\u0027s not really possible with the\nC++11 constexpr restrictions.\n\nSince we lower member initializers to constructor body statements\ninternally, and so constructor bodies are already effectively non-empty\ninternally even in C++11, supporting non-empty bodies in user code is\nmostly a matter of relaxing the parse-time error.\n\nBut constexpr-ex3.C revealed that by accepting the non-empty body of A\u0027s\nconstructor, build_data_member_initialization goes on to mistake the\n\u0027i \u003d _i\u0027 assignment as a member initializer, and we incorrectly accept\nthe constructor in C++11 mode (even though omitting mem-inits is only\nvalid since C++20).  Turns out this is caused by that function\nrecognizing MODIFY_EXPR only in C++11 mode, logic that was last changed\nby r5-5013 (presumably to limit impact of the patch at the time) but I\nreckon could just be removed outright.  This should be safe because the\nresult of build_data_member_initialization is only used by\ncx_check_missing_mem_inits for validation; evaluation is in terms of\nthe entire lowered constructor body.\n\n\tPR c++/123845\n\tPR libstdc++/114865\n\ngcc/cp/ChangeLog:\n\n\t* constexpr.cc (build_data_member_initialization): Remove\n\tC++11-specific recognition of MODIFY_EXPR.\n\t(check_constexpr_ctor_body): Relax error diagnostic to a\n\tpedwarn and don\u0027t clear DECL_DECLARED_CONSTEXPR_P upon\n\terror.  Return true if complaining.\n\ngcc/testsuite/ChangeLog:\n\n\t* g++.dg/cpp0x/constexpr-ex3.C: Adjust C++11 non-empty\n\tconstexpr constructor dg-error to a dg-warning.  Expect\n\ta follow-up missing member initializer diagnostic in C++11 mode.\n\t* g++.dg/cpp2a/constexpr-try1.C: Expect a follow-up\n\tcompound-statement in constexpr function diagnostic in C++11\n\tmode.\n\t* g++.dg/cpp2a/constexpr-try2.C: Likewise.  Adjust C++11\n\tnon-empty constexpr constructor dg-error to a dg-warning.\n\t* g++.dg/cpp2a/constexpr-try3.C:  Adjust C++11 non-empty\n\tconstexpr constructor dg-error to a dg-warning.\n\t* g++.dg/cpp0x/constexpr-ctor23.C: New test.\n\nReviewed-by: Jason Merrill \u003cjason@redhat.com\u003e\n(cherry picked from commit e4c57e146a224d0aaa71ace78f96fca1156add24)\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "0d30e5c7d9cc053c2d994a1e06aa036717189242",
      "old_mode": 33188,
      "old_path": "gcc/cp/constexpr.cc",
      "new_id": "a5078fc2fd679ca55d9e8d3f9838292f3240298d",
      "new_mode": 33188,
      "new_path": "gcc/cp/constexpr.cc"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "4019804ab1666fa9813b985de6775dab0da8e65d",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/g++.dg/cpp0x/constexpr-ctor23.C"
    },
    {
      "type": "modify",
      "old_id": "9d6d5ff587ca9a34745cbc09be8e3d3c893026b1",
      "old_mode": 33188,
      "old_path": "gcc/testsuite/g++.dg/cpp0x/constexpr-ex3.C",
      "new_id": "169976afbaf78917203e63e89587c73f152a6593",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/g++.dg/cpp0x/constexpr-ex3.C"
    },
    {
      "type": "modify",
      "old_id": "977eb86dd192bcbb69992786e6f69d810c10266e",
      "old_mode": 33188,
      "old_path": "gcc/testsuite/g++.dg/cpp2a/constexpr-try1.C",
      "new_id": "e5e70a62b50fecf9cfe5e81b7174b6e5156f3839",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/g++.dg/cpp2a/constexpr-try1.C"
    },
    {
      "type": "modify",
      "old_id": "7ca7261a9e0029c9a85e9114bdde35ca92a14916",
      "old_mode": 33188,
      "old_path": "gcc/testsuite/g++.dg/cpp2a/constexpr-try2.C",
      "new_id": "9504fdaa8696369037913e3fed61e3288006de7d",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/g++.dg/cpp2a/constexpr-try2.C"
    },
    {
      "type": "modify",
      "old_id": "ab7e8f6d4649a67033739e4422b6c60a52c128ee",
      "old_mode": 33188,
      "old_path": "gcc/testsuite/g++.dg/cpp2a/constexpr-try3.C",
      "new_id": "070040c5deef45d491a2e52113adbacf8b6c51b7",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/g++.dg/cpp2a/constexpr-try3.C"
    }
  ]
}
