From af9b9050ec51d0c43690fc42658741bd865b0310 Mon Sep 17 00:00:00 2001 From: Kim Barrett Date: Wed, 10 Sep 2025 03:30:16 +0000 Subject: [PATCH] 8366057: HotSpot Style Guide should permit trailing return types Reviewed-by: dholmes, stefank, kvn, adinn, jsjolen --- doc/hotspot-style.html | 52 ++++++++++++++++++++++++++++++++++++++---- doc/hotspot-style.md | 37 ++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+), 4 deletions(-) diff --git a/doc/hotspot-style.html b/doc/hotspot-style.html index 98d813242a5..fb4cffc9d43 100644 --- a/doc/hotspot-style.html +++ b/doc/hotspot-style.html @@ -75,6 +75,9 @@ Standard Library Deduction
  • Expression SFINAE
  • +
  • Trailing return type +syntax for functions
  • Non-type template parameter values
  • @@ -719,11 +722,14 @@ href="http://wg21.link/p0127r2">p0127r2)
    auto may be used as a placeholder for the type of a non-type template parameter. The type is deduced from the value provided in a template instantiation.

    -
  • Function return type deduction ( +

    * Function return type +deduction (n3638)
    Only use if the function body has a very small number of return -statements, and generally relatively little other code.

  • -
  • Class template argument deduction ( +

      ScopeGuard guard{[&]{ ... cleanup code ... }};