diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/static_assert7.C')
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/cpp0x/static_assert7.C | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/static_assert7.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/static_assert7.C new file mode 100644 index 0000000..f571de2 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/static_assert7.C @@ -0,0 +1,21 @@ +// PR c++/53166 +// { dg-do compile { target c++11 } } +// { dg-options "-Waddress" } + +template <typename X, X a> +struct A +{ + static_assert (a != nullptr, "oops"); + static_assert (nullptr != a, "oops"); + + int f() + { + static_assert (a != nullptr, "oops"); + static_assert (nullptr != a, "oops"); + return 1; + } +}; + +int i1; +A<int*, &i1> a1; +int i2 = a1.f(); |