[llvm-bugs] [Bug 27895] New: Clang incorrectly removes a definition

via llvm-bugs llvm-bugs at lists.llvm.org
Thu May 26 12:28:32 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=27895

            Bug ID: 27895
           Summary: Clang incorrectly removes a definition
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: katya_romanova at playstation.sony.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Consider the following test:

template < typename T, int N = 0 > class SafeHybridArray {
public:
  virtual T& operator [] (int aIndex);
  T ar[N+1];
};
template <typename T, int N> T& SafeHybridArray<T, N >::operator[](int i) {
return ar[i];}
extern SafeHybridArray<bool, 10> Blobs;
bool abcd(int a)
{
   return Blobs[a];
}

Clang removes a definition for SafeHybridArray<bool, 10>::operator[](int). I
don't see an explanation why this might be legal.

This started to happen after commit "r227073 - Don't let virtual calls and
dynamic casts call Sema::MarkVTableUsed()", so most likely it's a regression.

-- 
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/20160526/90b7e4d1/attachment.html>


More information about the llvm-bugs mailing list