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

            Bug ID: 41730
           Summary: [Address space] Missing check for validity of addr
                    space conversions for 'this' parameter
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangb...@nondot.org
          Reporter: anastasia.stul...@arm.com
                CC: blitzrak...@gmail.com, dgre...@apple.com,
                    erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
                    richard-l...@metafoo.co.uk

Currently Clang will accept invalid address space conversion generated
implicitly when passing objects to 'this' parameter.

For example:

struct MyType {
  MyType(int i) : i(i) {}
  int i;
};

MyType __attribute__((address_space(10))) m = 123;

This code should only be allowed if target permits conversions from AS 123 to 0
implicitly. However, we don't support yet target hooks to setup address space
conversions (explained in RFC:
http://lists.llvm.org/pipermail/cfe-dev/2019-March/061541.html) and therefore
adding such check will prevent using addr spaces in C++.

The solution to that could be addr space method qualifiers that is review:
https://reviews.llvm.org/D57464

See original discussion in https://reviews.llvm.org/D59988.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to