From ff2b66229e7374cb4d47fcfd6f255fae54bc9975 Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Wed, 15 Jan 2014 06:34:12 +0000 Subject: [PATCH] Fix the attribute enable_if example in the docs to be 100% real-world, instead of merely being close to the real world to mislead people. This now matches the test. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199298 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LanguageExtensions.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/LanguageExtensions.rst b/docs/LanguageExtensions.rst index 24ef8550c9..b6933838f0 100644 --- a/docs/LanguageExtensions.rst +++ b/docs/LanguageExtensions.rst @@ -1410,9 +1410,11 @@ available in C. .. code-block:: c++ - int isdigit(int c) __attribute__((enable_if(c >= -1 && c <= 255, "'c' must have the value of an unsigned char or EOF"))); + int isdigit(int c); + int isdigit(int c) __attribute__((enable_if(c <= -1 && c > 255, "chosen when 'c' is out of range"))) __attribute__((unavailable("'c' must have the value of an unsigned char or EOF"))); void foo(char c) { + isdigit(c); isdigit(10); isdigit(-10); // results in a compile-time error. } -- 2.40.0