[LLVMbugs] [Bug 19936] New: Templates, multiple declarations, decltype and operator overloading
    bugzilla-daemon at llvm.org 
    bugzilla-daemon at llvm.org
       
    Tue Jun  3 12:46:28 PDT 2014
    
    
  
http://llvm.org/bugs/show_bug.cgi?id=19936
            Bug ID: 19936
           Summary: Templates, multiple declarations, decltype and
                    operator overloading
           Product: clang
           Version: 3.4
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: royertiago at hotmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified
Created attachment 12600
  --> http://llvm.org/bugs/attachment.cgi?id=12600&action=edit
Rejected code.
The attached code do not compile under clang 3.4-1ubuntu1.
$ clang file.cpp -std=c++11
file.cpp:20:5: error: call to 'operator*' is ambiguous
...
However, the code compiles if either:
 - Lines 7-9 are removed.
 - Lines 8 and 12 are replaced with "C< T >".
 - operator* is replaced with operator/ in lines 9, 13 and 20.
 - The code
template< typename T >
using Result = C< decltype( (*(T*)0) * (*(T*)0) ) >;
   is inserted after the class definition, and lines 8 and 12 replaced with
"Result<T>".
Since this seems specific to operator*, I believe is a compiler bug.
(Sorry if bad english...)
-- 
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/20140603/c41095e2/attachment.html>
    
    
More information about the llvm-bugs
mailing list