summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/decl-microsoft-call-conv.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-12-10 00:59:31 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-12-10 00:59:31 +0000
commit66747221e8749a0f228bd47f43fb43bdb749e81a (patch)
tree91e41b7583ad5b8c44ce7ac0541defc97191213e /clang/test/SemaCXX/decl-microsoft-call-conv.cpp
parent1a74b6e11869fe221b7451b2db857472c35f14a6 (diff)
downloadbcm5719-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.cpp26
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}}
+ }
+}
OpenPOWER on IntegriCloud