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

           Summary: warn if class type has alignment greater than "new"
                    provides and doesn't overload operator new
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


I'd like a new warning that fires whenever a class has alignment that is larger
than that provided by the operator new, and doesn't provide its own operator
new. We could make it -Wobject-alignment=16 and off by default.

Sample:

  class Test {
    template <typename T>
    struct SeparateCacheLines {
      T data;
    } __attribute__((aligned(64)));

    SeparateCacheLines<int> high_contention_data[10];
  };

I'd like a warning that fires on class Test, "class Test can not be heap
allocated". It should not fire if operator new is overloaded. It should not
fire on SeparateCacheLines<> itself.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to