C++ Logo


Advanced search

Subject: Missing changes in P0012R1
From: v.S. F. (de34_at_[hidden])
Date: 2021-03-17 03:05:31

  Since C++17 (via P0012R1), except specifications have became part of the type system, and a noexcept function is implicitly convertible to a pointer to a non-noexcept function. However, it seems that calling a noexcept function through a pointer to a non-noexcept function is UB, as [expr.call]/6<https://eel.is/c++draft/expr.call#6> remains unchanged (known compilers accept such call in constant evaluation in C++17 and later modes).
  In the other hand, the definition “int main() noexcept {}” was guaranteed to be supported in C++11/14 (as noexcept was not part of the function type), but the guarantee is removed by P0012R1, because [basic.start.main]/2<https://eel.is/c++draft/basic.start.main#2> says about the type of main and remains unchanged.
  These cases should be addressed as CWG issue(s) IMO.

Jiang An

STD-DISCUSSION list run by std-discussion-owner@lists.isocpp.org

Older Archives on Google Groups