aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/MicrosoftCompatibility.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/MicrosoftCompatibility.cpp')
-rw-r--r--test/SemaCXX/MicrosoftCompatibility.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/SemaCXX/MicrosoftCompatibility.cpp b/test/SemaCXX/MicrosoftCompatibility.cpp
index 6a48f36801bd..05037ac6a0d0 100644
--- a/test/SemaCXX/MicrosoftCompatibility.cpp
+++ b/test/SemaCXX/MicrosoftCompatibility.cpp
@@ -178,3 +178,19 @@ namespace PR11791 {
del((void*)a); // expected-note {{in instantiation of function template specialization}}
}
}
+
+namespace IntToNullPtrConv {
+ struct Foo {
+ static const int ZERO = 0;
+ typedef void (Foo::*MemberFcnPtr)();
+ };
+
+ struct Bar {
+ const Foo::MemberFcnPtr pB;
+ };
+
+ Bar g_bar = { (Foo::MemberFcnPtr)Foo::ZERO };
+
+ template<int N> int *get_n() { return N; } // expected-warning {{expression which evaluates to zero treated as a null pointer constant}}
+ int *g_nullptr = get_n<0>(); // expected-note {{in instantiation of function template specialization}}
+}