diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-11-21 01:53:02 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-11-21 01:53:02 +0000 |
commit | e934d7c9f5165671f1715ed490c1c66bb8588922 (patch) | |
tree | 3613c2cb2d4bb223bee6802517be30abacab84e1 /clang/test/SemaTemplate/dependent-expr.cpp | |
parent | f22ef5ab1a5bae67c721a5b0478af41fdb18d241 (diff) | |
download | bcm5719-llvm-e934d7c9f5165671f1715ed490c1c66bb8588922.tar.gz bcm5719-llvm-e934d7c9f5165671f1715ed490c1c66bb8588922.zip |
PR10837: Warn if a null pointer constant is formed by a zero integer constant
expression that is not a zero literal, in C. This is a different, and more
targeted, approach than that in r194540.
llvm-svn: 195303
Diffstat (limited to 'clang/test/SemaTemplate/dependent-expr.cpp')
-rw-r--r-- | clang/test/SemaTemplate/dependent-expr.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/dependent-expr.cpp b/clang/test/SemaTemplate/dependent-expr.cpp index 01ac42ed421..2c26ec53a0a 100644 --- a/clang/test/SemaTemplate/dependent-expr.cpp +++ b/clang/test/SemaTemplate/dependent-expr.cpp @@ -79,3 +79,17 @@ template<typename T> struct CastDependentIntToPointer { return ((void*)(((unsigned long)(x)|0x1ul))); } }; + +// Regression test for crasher in r194540. +namespace PR10837 { + typedef void t(int); + template<typename> struct A { + void f(); + static t g; + }; + t *p; + template<typename T> void A<T>::f() { + p = g; + } + template struct A<int>; +} |