[LLVMbugs] [Bug 18176] cmath: compile failure with custom fabs in std namespace

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Dec 8 10:05:27 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=18176

Duncan <dexonsmith at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |dexonsmith at apple.com
         Resolution|---                         |INVALID

--- Comment #2 from Duncan <dexonsmith at apple.com> ---
(In reply to comment #1)
> I'm not completely sure, but I think your code relies on undefined behavior.
> §17.6.4.2.1p1:
> 
> | The behavior of a C++ program is undefined if it adds declarations or
> | definitions to namespace std or to a namespace within namespace std unless
> | otherwise specified. [...]
> 
> And §D.5, where cmath is described, does not say that it is possible to add
> e.g. fabs for a custom type to std.

Yup.  See also
<http://stackoverflow.com/questions/15104760/c11-overloading-not-specializing-templates-in-std-namespace>.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20131208/c12c00b0/attachment.html>


More information about the llvm-bugs mailing list