diff options
Diffstat (limited to 'test/SemaCXX/MicrosoftCompatibility.cpp')
-rw-r--r-- | test/SemaCXX/MicrosoftCompatibility.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/SemaCXX/MicrosoftCompatibility.cpp b/test/SemaCXX/MicrosoftCompatibility.cpp index 6a48f36..05037ac 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}} +} |