diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2013-12-22 00:07:40 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2013-12-22 00:07:40 +0000 |
| commit | bfef399519ca9b8a4b4c6b563253bad7e0eeffe0 (patch) | |
| tree | df8df0b0067b381eab470a3b8f28d14a552a6340 /test/SemaCXX/MicrosoftCompatibility.cpp | |
| parent | 6a0372513edbc473b538d2f724efac50405d6fef (diff) | |
Notes
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 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}} +} |
