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: [email protected]
          Reporter: [email protected]
                CC: [email protected]

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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to