[llvm-bugs] [Bug 25694] New: Clang 3.6 regression: noexcept expression doesn't seem to pick up global function overload

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Dec 1 09:52:32 PST 2015


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

            Bug ID: 25694
           Summary: Clang 3.6 regression: noexcept expression doesn't seem
                    to pick up global function overload
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: wanyingloo at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org,
                    sig-clang-bugs at synopsys.com
    Classification: Unclassified

This is reproducible in the trunk.

$ cat test.cpp
int a, b;
template<class T> void swap(T&, T&); 
template<class T> struct foo
{
  void swap(foo<T>& _Right) noexcept(noexcept(swap(a, b)))
  {}
};

template<class T>
void swap(foo<T>& Left, foo<T>& Right) noexcept(noexcept(Left.swap(Right)))
{}

void test()
{
  foo<int> p1, p2;
  swap(p1, p2);
}

$ ./clang-3.5.0/bin/clang -c -std=c++11 test.cpp

$ ./clang-3.6.0/bin/clang -c -std=c++11 test.cpp
test.cpp:5:55: error: too many arguments to function call, expected single
argument '_Right', have 2 arguments
  void swap(foo<T>& _Right) noexcept(noexcept(swap(a, b)))
                                              ~~~~    ^
test.cpp:10:58: note: in instantiation of exception specification for 'swap'
requested here
void swap(foo<T>& Left, foo<T>& Right) noexcept(noexcept(Left.swap(Right)))
                                                         ^
test.cpp:16:3: note: in instantiation of exception specification for
'swap<int>' requested here
  swap(p1, p2);
  ^
test.cpp:5:3: note: 'swap' declared here
  void swap(foo<T>& _Right) noexcept(noexcept(swap(a, b)))
  ^
1 error generated.

-- 
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/20151201/69296fe6/attachment.html>


More information about the llvm-bugs mailing list