<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [AVR] can not compile calls to non-static member functions of objects in progmem address space / program memory / Flash"
   href="https://bugs.llvm.org/show_bug.cgi?id=49801">49801</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[AVR] can not compile calls to non-static member functions of objects in progmem address space / program memory / Flash
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>11.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: AVR
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>david.hebbeker@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>