From 2e298b8bf45edc37269b8b70f7784082a8f87306 Mon Sep 17 00:00:00 2001 From: Kim Barrett Date: Mon, 7 Mar 2022 18:20:01 +0000 Subject: [PATCH] 8272691: Fix HotSpot style guide terminology for "non-local variables" Reviewed-by: dcubed, dholmes --- doc/hotspot-style.html | 2 +- doc/hotspot-style.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/hotspot-style.html b/doc/hotspot-style.html index 4fd5c5a9064..453b9fbc14b 100644 --- a/doc/hotspot-style.html +++ b/doc/hotspot-style.html @@ -438,7 +438,7 @@ while ( test_foo(args...) ) { // No, excess spaces around control

Inline namespaces (n2535) — HotSpot makes very limited use of namespaces.

  • using namespace directives. In particular, don't use using namespace std; to avoid needing to qualify Standard Library names.

  • Propagating exceptions (n2179) — HotSpot does not permit the use of exceptions, so this feature isn't useful.

  • -
  • Avoid namespace-scoped variables with non-constexpr initialization. In particular, avoid variables with types requiring non-trivial initialization or destruction. Initialization order problems can be difficult to deal with and lead to surprises, as can destruction ordering. HotSpot doesn't generally try to cleanup on exit, and running destructors at exit can also lead to problems.

  • +
  • Avoid non-local variables with non-constexpr initialization. In particular, avoid variables with types requiring non-trivial initialization or destruction. Initialization order problems can be difficult to deal with and lead to surprises, as can destruction ordering. HotSpot doesn't generally try to cleanup on exit, and running destructors at exit can also lead to problems.

  • [[deprecated]] attribute (n3760) — Not relevant in HotSpot code.

  • Avoid most operator overloading, preferring named functions. When operator overloading is used, ensure the semantics conform to the normal expected behavior of the operation.

  • Avoid most implicit conversion constructors and (implicit or explicit) conversion operators. (Note that conversion to bool isn't needed in HotSpot code because of the "no implicit boolean" guideline.)

  • diff --git a/doc/hotspot-style.md b/doc/hotspot-style.md index 5d25cdb6667..84cb22a1bda 100644 --- a/doc/hotspot-style.md +++ b/doc/hotspot-style.md @@ -1066,7 +1066,7 @@ namespace std;` to avoid needing to qualify Standard Library names. ([n2179](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html)) — HotSpot does not permit the use of exceptions, so this feature isn't useful. -* Avoid namespace-scoped variables with non-constexpr initialization. +* Avoid non-local variables with non-constexpr initialization. In particular, avoid variables with types requiring non-trivial initialization or destruction. Initialization order problems can be difficult to deal with and lead to surprises, as can destruction