aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/warn/Wnull-conversion-2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/warn/Wnull-conversion-2.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/warn/Wnull-conversion-2.C58
1 files changed, 34 insertions, 24 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/warn/Wnull-conversion-2.C b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wnull-conversion-2.C
index 92a87d1e7..6ce7605c5 100644
--- a/gcc-4.9/gcc/testsuite/g++.dg/warn/Wnull-conversion-2.C
+++ b/gcc-4.9/gcc/testsuite/g++.dg/warn/Wnull-conversion-2.C
@@ -3,43 +3,53 @@
#include <stddef.h>
-class Foo {
- public:
- template <typename T1, typename T2>
- static void Compare(const T1& expected, const T2& actual) { }
+class Foo
+{
+public:
+ template < typename T1, typename T2 >
+ static void Compare (const T1 & expected, const T2 & actual)
+ {
+ }
- template <typename T1, typename T2>
- static void Compare(const T1& expected, T2* actual) { }
+ template < typename T1, typename T2 >
+ static void Compare (const T1 & expected, T2 * actual)
+ {
+ }
};
-template<typename T1>
-class Foo2 {
- public:
- Foo2(int x);
- template<typename T2> void Bar(T2 y);
+template < typename T1 > class Foo2
+{
+public:
+ Foo2 (int x);
+ template < typename T2 > void Bar (T2 y);
};
-template<typename T3> void func(T3 x) { }
+template < typename T3 > void
+func (T3 x)
+{
+}
-typedef Foo2<int> MyFooType;
+typedef Foo2 < int >MyFooType;
-void func1(long int a) {
- MyFooType *foo2 = new MyFooType(NULL); // { dg-warning "passing NULL to" }
- foo2->Bar(a);
- func(NULL);
- func<int>(NULL); // { dg-warning "passing NULL to" }
- func<int *>(NULL);
+void
+func1 (long int a)
+{
+ MyFooType *foo2 = new MyFooType (NULL); // { dg-warning "passing NULL to" }
+ foo2->Bar (a);
+ func (NULL);
+ func < int >(NULL); // { dg-warning "passing NULL to" }
+ func < int *>(NULL);
}
int x = 1;
-main()
+main ()
{
int *p = &x;
- Foo::Compare(0, *p);
- Foo::Compare<long int, int>(NULL, p); // { dg-warning "passing NULL to" }
- Foo::Compare(NULL, p);
- func1(NULL); // { dg-warning "passing NULL to" }
+ Foo::Compare (0, *p);
+ Foo::Compare < long int, int >(NULL, p); // { dg-warning "passing NULL to" }
+ Foo::Compare (NULL, p);
+ func1 (NULL); // { dg-warning "passing NULL to" }
}