]> granicus.if.org Git - clang/commit
Sema: Do not allow overloading between methods based on restrict
authorDavid Majnemer <david.majnemer@gmail.com>
Sun, 3 Nov 2013 23:51:28 +0000 (23:51 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Sun, 3 Nov 2013 23:51:28 +0000 (23:51 +0000)
commit62e9370d9da9ee4f675da52d559a79c93c30642e
treeae46d434139a95f6bc110cb6b080784297446bc8
parent3a50d847e098f36e3bf8bc14eea07a6cc35f7803
Sema: Do not allow overloading between methods based on restrict

If the sole distinction between two declarations is that one has a
__restrict qualifier then we should not consider it to be an overload.

Instead, we will consider it as an incompatible redeclaration which is
similar to how MSVC, ICC and GCC would handle it.

This fixes PR17786.

N.B. We must not mangle in __restrict into method qualifiers becase we
don't allow overloading between such declarations anymore.  To do
otherwise would be a violation of the Itanium ABI.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193964 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AST/ItaniumMangle.cpp
lib/Sema/SemaOverload.cpp
test/CodeGenCXX/mangle.cpp
test/SemaCXX/overload-decl.cpp