From 14a014d4303efda69bd0acbdf71139534601b49a Mon Sep 17 00:00:00 2001
From: Kim Barrett
Date: Tue, 28 Feb 2023 01:59:03 +0000
Subject: [PATCH] 8302124: HotSpot Style Guide should permit noreturn attribute
Reviewed-by: dcubed, iveresov, dholmes, tschatzl, jwaters, kvn
---
doc/hotspot-style.html | 31 ++++++++++++++++++++++++++-----
doc/hotspot-style.md | 33 ++++++++++++++++++++++++++-------
2 files changed, 52 insertions(+), 12 deletions(-)
diff --git a/doc/hotspot-style.html b/doc/hotspot-style.html
index 777d69b0a2e..d1906f49374 100644
--- a/doc/hotspot-style.html
+++ b/doc/hotspot-style.html
@@ -82,6 +82,7 @@ id="toc-uniform-initialization">Uniform Initialization
id="toc-local-function-objects">Local Function Objects
Inheriting constructors
+Attributes
Additional Permitted
Features
@@ -1057,6 +1058,31 @@ using C++17 or later. It is also enabled by default for
C++11/14, as the change is considered a Defect Report that applies to
those versions. Earlier versions of gcc don't have that option, and
other supported compilers may not have anything similar.
+Attributes
+The use of some attributes (n2761)
+(listed below) is permitted. (Note that some of the attributes defined
+in that paper didn't make it into the final specification.)
+Attributes are syntactically permitted in a broad set of locations,
+but specific attributes are only permitted in a subset of those
+locations. In some cases an attribute that appertains to a given element
+may be placed in any of several locations with the same meaning. In
+those cases HotSpot has a preferred location.
+
+- An attribute that appertains to a function is placed at the
+beginning of the function's declaration, rather than between the
+function name and the parameter list.
+
+Only the following attributes are permitted:
+
+The following attributes are expressly forbidden:
+
+[[carries_dependency]] - Related to
+memory_order_consume.
+[[deprecated]] - Not relevant in HotSpot code.
+
Additional Permitted
Features
@@ -1149,9 +1175,6 @@ 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.
@@ -1171,8 +1194,6 @@ href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm">n2541
href="https://isocpp.org/files/papers/N3651.pdf">n3651)
Member initializers and aggregates (n3653)
-[[noreturn]] attribute (n2761)
Rvalue references and move semantics