From 565b4c0d5325c4fc9a4d9fddaec5322d6ed8a159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Ferreira?= Date: Wed, 4 Aug 2021 00:58:44 +0100 Subject: [PATCH] spec: DIP1029: Add `throw` as Function Attribute MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Luís Ferreira --- spec/attribute.dd | 9 +++++++++ spec/declaration.dd | 1 + 2 files changed, 10 insertions(+) diff --git a/spec/attribute.dd b/spec/attribute.dd index e8a8783826..adcb0f4aba 100644 --- a/spec/attribute.dd +++ b/spec/attribute.dd @@ -34,6 +34,7 @@ $(GNAME Attribute): $(RELATIVE_LINK2 return, $(D return)) $(GNAME FunctionAttributeKwd): + $(RELATIVE_LINK2 throw, $(D throw)) $(RELATIVE_LINK2 nothrow, $(D nothrow)) $(RELATIVE_LINK2 pure, $(D pure)) @@ -793,6 +794,14 @@ pragma(msg, __traits(getAttributes, typeof(a))); // prints tuple("hello") $(P UDAs cannot be attached to template parameters. ) + +$(H2 $(LNAME2 throw, $(D throw) Attribute)) + $(P + The $(D throw) attribute is used in function declarations to indicate that a function + may throw. Contrary of $(D nothrow) attribute. + ) + + $(SPEC_SUBNAV_PREV_NEXT property, Properties, pragma, Pragmas) ) diff --git a/spec/declaration.dd b/spec/declaration.dd index 91d0f4f343..291716eb96 100644 --- a/spec/declaration.dd +++ b/spec/declaration.dd @@ -105,6 +105,7 @@ $(MULTICOLS 5, $(GLINK2 attribute, LinkageAttribute) $(D shared) $(D __gshared) $(GLINK2 attribute, Property) + $(D throw) $(D nothrow) $(D pure) $(D ref))