[LLVMbugs] [Bug 10036] New: noexcept can't reference member data

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri May 27 08:04:37 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=10036

           Summary: noexcept can't reference member data
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++0x
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: hhinnant at apple.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Apple clang version 3.0 (trunk 131788) (based on LLVM 3.0svn)
Target: x86_64-apple-darwin10.7.0
Thread model: posix

Here is a minimal test case:


template <class I>
void
iter_swap(I x, I y) noexcept;

template <class T>
class A
{
    T t_;
public:
    void swap(A& a) noexcept(noexcept(iter_swap(&t_, &a.t_)));
};

int main()
{
    A<int> i, j;
    i.swap(j);
}


test.cpp:10:56: error: member access into incomplete type 'A<int>'
    void swap(A& a) noexcept(noexcept(iter_swap(&t_, &a.t_)));
                                                       ^
test.cpp:15:12: note: in instantiation of template class 'A<int>' requested
here
    A<int> i, j;
           ^
test.cpp:6:7: note: definition of 'A<int>' is not complete until the closing
'}'
class A
      ^
1 error generated.

The expectation is for this to compile.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list