summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-interfaces-global-init.rst
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2016-04-08 09:51:06 +0000
committerAlexander Kornienko <alexfh@google.com>2016-04-08 09:51:06 +0000
commit477e5d8d3160367e03edc1343900e87267b22fac (patch)
treef5e5a05f82971dca8c0310439c0ffe5470c706fa /clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-interfaces-global-init.rst
parentad659c3400d03fe1797c5b00eb825d4b6b745686 (diff)
downloadbcm5719-llvm-477e5d8d3160367e03edc1343900e87267b22fac.tar.gz
bcm5719-llvm-477e5d8d3160367e03edc1343900e87267b22fac.zip
[clang-tidy] cppcoreguidelines-interfaces-global-init
Summary: This check flags initializers of globals that access extern objects, and therefore can lead to order-of-initialization problems (this recommandation is part of CPP core guidelines). Note that this only checks half of the guideline for now (it does not enforce using constexpr functions). Reviewers: aaron.ballman, alexfh Subscribers: aaron.ballman, etienneb, Eugene.Zelenko, cfe-commits Patch by Clement Courbet! Differential Revision: http://reviews.llvm.org/D18649 llvm-svn: 265774
Diffstat (limited to 'clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-interfaces-global-init.rst')
-rw-r--r--clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-interfaces-global-init.rst14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-interfaces-global-init.rst b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-interfaces-global-init.rst
new file mode 100644
index 00000000000..490785846da
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-interfaces-global-init.rst
@@ -0,0 +1,14 @@
+.. title:: clang-tidy - cppcoreguidelines-interfaces-global-init
+
+cppcoreguidelines-interfaces-global-init
+========================================
+
+This check flags initializers of globals that access extern objects,
+and therefore can lead to order-of-initialization problems.
+
+This rule is part of the "Interfaces" profile of the C++ Core Guidelines, see
+https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Ri-global-init
+
+Note that currently this does not flag calls to non-constexpr functions, and
+therefore globals could still be accessed from functions themselves.
+
OpenPOWER on IntegriCloud