diff options
author | David Majnemer <david.majnemer@gmail.com> | 2013-11-03 23:51:28 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2013-11-03 23:51:28 +0000 |
commit | 42350dfcc82c0f9a67feaacaa6581fdd54841416 (patch) | |
tree | f05dabdbd9189d96f1666b7a97c9697f8969b06c /clang/test/CodeGenCXX/mangle.cpp | |
parent | 99c096472d789c7f60c81f99b28b3071565c9508 (diff) | |
download | bcm5719-llvm-42350dfcc82c0f9a67feaacaa6581fdd54841416.tar.gz bcm5719-llvm-42350dfcc82c0f9a67feaacaa6581fdd54841416.zip |
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.
llvm-svn: 193964
Diffstat (limited to 'clang/test/CodeGenCXX/mangle.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/mangle.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/mangle.cpp b/clang/test/CodeGenCXX/mangle.cpp index 4e6dbf5397a..d836f36c181 100644 --- a/clang/test/CodeGenCXX/mangle.cpp +++ b/clang/test/CodeGenCXX/mangle.cpp @@ -942,3 +942,12 @@ namespace test43 { void g(zed<&foo::bar>*) {} } + +namespace test44 { + struct foo { void bar() __restrict { }; } obj; + + void f() { + obj.bar(); + } + // CHECK-LABEL: define linkonce_odr void @_ZN6test443foo3barEv(%"struct.test44::foo"* %this) +} |