[llvm-bugs] [Bug 49801] New: [AVR] can not compile calls to non-static member functions of objects in progmem address space / program memory / Flash

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 1 00:57:24 PDT 2021


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

            Bug ID: 49801
           Summary: [AVR] can not compile calls to non-static member
                    functions of objects in progmem address space /
                    program memory / Flash
           Product: libraries
           Version: 11.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: AVR
          Assignee: unassignedbugs at nondot.org
          Reporter: david.hebbeker at gmail.com
                CC: llvm-bugs at lists.llvm.org

Steps to Reproduce
------------------

Define an object in address space 1 and call one of its non-static member
functions.

Minimal example:

```
struct S {
  const int a;
  int get() const { return a; }
} const __attribute__((address_space(1))) s = { 42 };

int main() {
    return s.get();
}
```

Compiling with `clang -mmcu=atxmega256a3u --target=avr -nostdlib`

Actual Results
--------------

Unexpected compiler error:

```
error: cannot initialize object parameter of type 'const S' with an expression
of type 'const __attribute__((address_space(1))) struct S'
    return s.get();
           ^
```

Expected Results
----------------

clang / AVR LLVM compiles without error.


Additional Information
----------------------

May be related to bug report #25941.

-- 
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/20210401/ab535302/attachment.html>


More information about the llvm-bugs mailing list