diff options
author | Jason Merrill <jason@redhat.com> | 2009-02-03 18:09:11 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2009-02-03 18:09:11 -0500 |
commit | d0db89893f32405918a613be61232735d8356002 (patch) | |
tree | 8af6a8944f40d41a9a8887e4cc669bd46a417a5c /gcc/testsuite | |
parent | 6175f5785a720106f5f6c2c051f46aac8a2d7a01 (diff) | |
download | gcc-d0db89893f32405918a613be61232735d8356002.zip gcc-d0db89893f32405918a613be61232735d8356002.tar.gz gcc-d0db89893f32405918a613be61232735d8356002.tar.bz2 |
typeck.c (cp_build_unary_op): Only complain about taking address of main if pedantic.
* typeck.c (cp_build_unary_op): Only complain about taking address
of main if pedantic.
From-SVN: r143911
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/warn/main-4.C | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.bugs/900227_01.C | 6 |
3 files changed, 12 insertions, 4 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9d50d7f..67369d9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-02-03 Jason Merrill <jason@redhat.com> + + * g++.dg/warn/main-4.C: New test. + * g++.old-deja/g++.bugs/900227_01.C: Remove &main warnings. + 2009-02-03 Andrew Pinski <andrew_pinski@playstation.sony.com> PR C++/36607 diff --git a/gcc/testsuite/g++.dg/warn/main-4.C b/gcc/testsuite/g++.dg/warn/main-4.C new file mode 100644 index 0000000..ad2dd70 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/main-4.C @@ -0,0 +1,5 @@ +// This pattern is used by a lot of autoconf scripts, so don't +// complain about it unless -pedantic. +// { dg-options "" } + +int main () { main (); return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900227_01.C b/gcc/testsuite/g++.old-deja/g++.bugs/900227_01.C index 2bd4f3d..b441eff 100644 --- a/gcc/testsuite/g++.old-deja/g++.bugs/900227_01.C +++ b/gcc/testsuite/g++.old-deja/g++.bugs/900227_01.C @@ -33,9 +33,7 @@ int main (); -short s = (short) &main; // { dg-error "taking address" "addr" { xfail h8*-*-* xstormy16-*-* } } -// { dg-error "loses precision" "lose" { xfail h8*-*-* xstormy16-*-* } 36 } -char c = (char) &main; // { dg-error "taking address" } -// { dg-error "loses precision" "lose" { target *-*-* } 38 } +short s = (short) &main; // { dg-error "loses precision" "lose" { xfail h8*-*-* xstormy16-*-* } } +char c = (char) &main; // { dg-error "loses precision" "lose" } int main () { return 0; } |