[llvm-bugs] [Bug 47417] New: Class member used in a member function has not yet been instantiated

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Sep 4 05:08:28 PDT 2020


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

            Bug ID: 47417
           Summary: Class member used in a member function has not yet
                    been instantiated
           Product: new-bugs
           Version: 10.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: lozanbt47 at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

Created attachment 23927
  --> https://bugs.llvm.org/attachment.cgi?id=23927&action=edit
Minimal case that describes the issue

If in a template class we have a constexpr member function which also has
'used' attribute, then in the function we cannot use member variables which are
declared below the member function. In such a case, we'll get the following
error:

error: no member 'X' in 'Y'; it has not yet been instantiated


If we move the declaration of the member variables above the function
definition, then everything works properly.

Also, if we remove constexpr or __attribute__((used)) then it works properly.

-- 
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/20200904/9d0ad4ce/attachment.html>


More information about the llvm-bugs mailing list