summaryrefslogtreecommitdiff
path: root/m4/ax_cxx_dtor_after_atexit.m4
diff options
context:
space:
mode:
authorBastien ROUCARIÈS <roucaries.bastien@gmail.com>2015-01-01 17:59:52 +0100
committerBastien ROUCARIÈS <roucaries.bastien@gmail.com>2015-01-04 12:53:51 +0100
commite3c5810d10d4eccca756896eac9a1624a5ad11c2 (patch)
tree308856563233ad263ae3b65641b4948bc65e0bed /m4/ax_cxx_dtor_after_atexit.m4
parent44a16f8a6530f5fadab3b8544834fcc087aadaef (diff)
downloadautoconf-archive-e3c5810d10d4eccca756896eac9a1624a5ad11c2.tar.gz
Clarify why ax_cxx_dtor_after_atexit.m4
Use reference to c++ standard
Diffstat (limited to 'm4/ax_cxx_dtor_after_atexit.m4')
-rw-r--r--m4/ax_cxx_dtor_after_atexit.m422
1 files changed, 18 insertions, 4 deletions
diff --git a/m4/ax_cxx_dtor_after_atexit.m4 b/m4/ax_cxx_dtor_after_atexit.m4
index 5de88c0..ee05aa6 100644
--- a/m4/ax_cxx_dtor_after_atexit.m4
+++ b/m4/ax_cxx_dtor_after_atexit.m4
@@ -9,9 +9,23 @@
# DESCRIPTION
#
# If the C++ compiler calls global destructors after atexit functions,
-# define HAVE_DTOR_AFTER_ATEXIT. WARNING: If cross-compiling, the test
-# cannot be performed, the default action is to define
-# HAVE_DTOR_AFTER_ATEXIT.
+# define HAVE_DTOR_AFTER_ATEXIT.
+#
+# Per Paragraph 3.6.3/1 of the C++11 Standard:
+#
+# Destructors (12.4) for initialized objects [..] with static storage
+# duration are called as a result of returning from main and as a result
+# of calling std::exit (18.5).
+#
+# And per Paragraph 3.6.3/3:
+#
+# If the completion of the initialization of an object with static storage
+# duration is sequenced before a call to std::atexit [..], the call to the
+# function passed to std::atexit is sequenced before the call to the
+# destructor for the object.
+#
+# WARNING: If cross-compiling, the test cannot be performed, the default
+# action is to define HAVE_DTOR_AFTER_ATEXIT.
#
# LICENSE
#
@@ -23,7 +37,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 6
+#serial 7
AU_ALIAS([AC_CXX_DTOR_AFTER_ATEXIT], [AX_CXX_DTOR_AFTER_ATEXIT])
AC_DEFUN([AX_CXX_DTOR_AFTER_ATEXIT],