diff options
author | Yunzhong Gao <Yunzhong_Gao@playstation.sony.com> | 2014-04-12 02:25:32 +0000 |
---|---|---|
committer | Yunzhong Gao <Yunzhong_Gao@playstation.sony.com> | 2014-04-12 02:25:32 +0000 |
commit | c573acccd2baaff713f742ab2f1cea9b5b919b67 (patch) | |
tree | ffed50bdeda7e1c018a753031414a2f007696384 /docs | |
parent | 78c3eb55beb61db64e166af7aee811326f614d96 (diff) | |
download | clang_35a-c573acccd2baaff713f742ab2f1cea9b5b919b67.tar.gz |
Add description about the __is_identifier() macro
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206099 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r-- | docs/LanguageExtensions.rst | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/LanguageExtensions.rst b/docs/LanguageExtensions.rst index 392e679f15..899ce728ba 100644 --- a/docs/LanguageExtensions.rst +++ b/docs/LanguageExtensions.rst @@ -134,6 +134,26 @@ The attribute name can also be specified with a preceding and following ``__`` (double underscore) to avoid interference from a macro with the same name. For instance, ``__always_inline__`` can be used instead of ``always_inline``. +``__is_identifier`` +------------------- + +This function-like macro takes a single identifier argument that might be either +a reserved word or a regular identifier. It evaluates to 1 if the argument is just +a regular identifier and not a reserved word, in the sense that it can then be +used as the name of a user-defined function or variable. Otherwise it evaluates +to 0. It can be used like this: + +.. code-block:: c++ + + ... + #ifdef __is_identifier // Compatibility with non-clang compilers. + #if __is_identifier(__wchar_t) + typedef wchar_t __wchar_t; + #endif + #endif + + __wchar_t WideCharacter; + ... Include File Checking Macros ============================ |