diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2016-05-14 17:44:14 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2016-05-14 17:44:14 +0000 |
commit | 2eeddfb1efc8200468725c50647e3b250b28e902 (patch) | |
tree | 1c8b72219c1fce87621af755a546b18ce7ef6e63 /clang/test/SemaCXX/static-cast.cpp | |
parent | 962b2cda9cfa93b48aa044783209a3939d66b73d (diff) | |
download | bcm5719-llvm-2eeddfb1efc8200468725c50647e3b250b28e902.tar.gz bcm5719-llvm-2eeddfb1efc8200468725c50647e3b250b28e902.zip |
Warn when a reference is bound to an empty l-value (dereferenced null pointer).
llvm-svn: 269572
Diffstat (limited to 'clang/test/SemaCXX/static-cast.cpp')
-rw-r--r-- | clang/test/SemaCXX/static-cast.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/test/SemaCXX/static-cast.cpp b/clang/test/SemaCXX/static-cast.cpp index b3fe49a88c6..ff47c0bb4dc 100644 --- a/clang/test/SemaCXX/static-cast.cpp +++ b/clang/test/SemaCXX/static-cast.cpp @@ -43,11 +43,11 @@ void t_529_2() (void)static_cast<void*>((int*)0); (void)static_cast<volatile const void*>((const int*)0); (void)static_cast<A*>((B*)0); - (void)static_cast<A&>(*((B*)0)); + (void)static_cast<A&>(*((B*)0)); // expected-warning {{binding dereferenced null pointer to reference has undefined behavior}} (void)static_cast<const B*>((C1*)0); - (void)static_cast<B&>(*((C1*)0)); + (void)static_cast<B&>(*((C1*)0)); // expected-warning {{binding dereferenced null pointer to reference has undefined behavior}} (void)static_cast<A*>((D*)0); - (void)static_cast<const A&>(*((D*)0)); + (void)static_cast<const A&>(*((D*)0)); // expected-warning {{binding dereferenced null pointer to reference has undefined behavior}} (void)static_cast<int B::*>((int A::*)0); (void)static_cast<void (B::*)()>((void (A::*)())0); |