r199298 - 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.

Nick Lewycky nicholas at mxc.ca
Tue Jan 14 22:34:12 PST 2014


Author: nicholas
Date: Wed Jan 15 00:34:12 2014
New Revision: 199298

URL: http://llvm.org/viewvc/llvm-project?rev=199298&view=rev
Log:
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.

Modified:
    cfe/trunk/docs/LanguageExtensions.rst

Modified: cfe/trunk/docs/LanguageExtensions.rst
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/LanguageExtensions.rst?rev=199298&r1=199297&r2=199298&view=diff
==============================================================================
--- cfe/trunk/docs/LanguageExtensions.rst (original)
+++ cfe/trunk/docs/LanguageExtensions.rst Wed Jan 15 00:34:12 2014
@@ -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.
   }





More information about the cfe-commits mailing list