From 82a48226107e2ee0d073eaf521750c8354b67e41 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 11 Oct 2018 18:08:03 -0400 Subject: CMP0053: document that `$` is a valid literal variable character This was overlooked in the initial implementation of CMP0053. However, an additional policy to reject it again is not worth it. Instead, add tests and document the behavior. Fixes: #17883 --- Help/manual/cmake-language.7.rst | 5 +++-- Help/policy/CMP0053.rst | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'Help') diff --git a/Help/manual/cmake-language.7.rst b/Help/manual/cmake-language.7.rst index 591f73d916..71649ba3e7 100644 --- a/Help/manual/cmake-language.7.rst +++ b/Help/manual/cmake-language.7.rst @@ -391,8 +391,9 @@ inside out, e.g. ``${outer_${inner_variable}_variable}``. Literal variable references may consist of alphanumeric characters, the characters ``/_.+-``, and `Escape Sequences`_. Nested references -may be used to evaluate variables of any name. (See also policy -:policy:`CMP0053` documentation for historical considerations.) +may be used to evaluate variables of any name. See also policy +:policy:`CMP0053` documentation for historical considerations and reasons why +the ``$`` is also technically permitted but is discouraged. The `Variables`_ section documents the scope of variable names and how their values are set. diff --git a/Help/policy/CMP0053.rst b/Help/policy/CMP0053.rst index 2620a60e03..032b3e5c63 100644 --- a/Help/policy/CMP0053.rst +++ b/Help/policy/CMP0053.rst @@ -16,6 +16,10 @@ cleaned up to simplify the behavior. Specifically: * Literal ``${VAR}`` reference syntax may contain only alphanumeric characters (``A-Z``, ``a-z``, ``0-9``) and the characters ``_``, ``.``, ``/``, ``-``, and ``+``. + Note that ``$`` is technically allowed in the ``NEW`` behavior, but is + invalid for ``OLD`` behavior. This is due to an oversight during the + implementation of :policy:`CMP0053` and its use as a literal variable + reference is discouraged for this reason. Variables with other characters in their name may still be referenced indirectly, e.g. -- cgit v1.2.1