diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-12-10 00:59:31 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-12-10 00:59:31 +0000 |
commit | 66747221e8749a0f228bd47f43fb43bdb749e81a (patch) | |
tree | 91e41b7583ad5b8c44ce7ac0541defc97191213e /clang/test/SemaCXX/decl-microsoft-call-conv.cpp | |
parent | 1a74b6e11869fe221b7451b2db857472c35f14a6 (diff) | |
download | bcm5719-llvm-66747221e8749a0f228bd47f43fb43bdb749e81a.tar.gz bcm5719-llvm-66747221e8749a0f228bd47f43fb43bdb749e81a.zip |
Take into consideration calling convention when processing specializations.
This fixes pr18141.
llvm-svn: 196855
Diffstat (limited to 'clang/test/SemaCXX/decl-microsoft-call-conv.cpp')
-rw-r--r-- | clang/test/SemaCXX/decl-microsoft-call-conv.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/decl-microsoft-call-conv.cpp b/clang/test/SemaCXX/decl-microsoft-call-conv.cpp index fd20ae234ec..fa782ead349 100644 --- a/clang/test/SemaCXX/decl-microsoft-call-conv.cpp +++ b/clang/test/SemaCXX/decl-microsoft-call-conv.cpp @@ -203,3 +203,29 @@ namespace test6 { zed(&foo::bar); } } + +namespace test7 { + template <typename T> + struct S { + void f(T t) { + t = 42; + } + }; + template<> void S<void*>::f(void*); + void g(S<void*> s, void* p) { + s.f(p); + } +} + +namespace test8 { + template <typename T> + struct S { + void f(T t) { // expected-note {{previous declaration is here}} + t = 42; // expected-error {{assigning to 'void *' from incompatible type 'int'}} + } + }; + template<> void __cdecl S<void*>::f(void*); // expected-error {{function declared 'cdecl' here was previously declared without calling convention}} + void g(S<void*> s, void* p) { + s.f(p); // expected-note {{in instantiation of member function 'test8::S<void *>::f' requested here}} + } +} |