diff options
author | Joost VandeVondele <vondele@gcc.gnu.org> | 2014-08-22 10:14:50 +0000 |
---|---|---|
committer | Joost VandeVondele <vondele@gcc.gnu.org> | 2014-08-22 10:14:50 +0000 |
commit | 7e114fadf1ac83f36b1b84c60045ba016c4f37fa (patch) | |
tree | e461b437e15bff0158a42c3f3887302a848895db /gcc/testsuite | |
parent | 3616dc706e703902088fcf055af5da7d410ea18f (diff) | |
download | gcc-7e114fadf1ac83f36b1b84c60045ba016c4f37fa.zip gcc-7e114fadf1ac83f36b1b84c60045ba016c4f37fa.tar.gz gcc-7e114fadf1ac83f36b1b84c60045ba016c4f37fa.tar.bz2 |
re PR fortran/61234 (Warn for use-stmt without explicit only-list.)
2014-08-22 Joost VandeVondele <Joost.VandeVondele@mat.ethz.ch>
* gfortran.dg/use_without_only_1.f90: New test.
2014-08-22 Joost VandeVondele <Joost.VandeVondele@mat.ethz.ch>
PR fortran/61234
* lang.opt (Wuse-without-only): New flag.
* gfortran.h (gfc_option_t): Add it.
* invoke.texi: Document it.
* module.c (gfc_use_module): Warn if needed.
* options.c (gfc_init_options,gfc_handle_option): Init accordingly.
From-SVN: r214311
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/use_without_only_1.f90 | 22 |
2 files changed, 27 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 92b9c9e..8dd980b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2014-08-22 Joost VandeVondele <Joost.VandeVondele@mat.ethz.ch> + + * gfortran.dg/use_without_only_1.f90: New test. + 2014-08-22 Igor Zamyatin <igor.zamyatin@intel.com> PR other/62008 @@ -5,7 +9,7 @@ 2014-08-22 Tony Wang <tony.wang@arm.com> - * g++.dg/tls/thread_local6.C: Skip this test case when target uses + * g++.dg/tls/thread_local6.C: Skip this test case when target uses dejagnu wrapper. 2014-08-21 Thomas Koenig <tkoenig@gcc.gnu.org> diff --git a/gcc/testsuite/gfortran.dg/use_without_only_1.f90 b/gcc/testsuite/gfortran.dg/use_without_only_1.f90 new file mode 100644 index 0000000..8554539 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/use_without_only_1.f90 @@ -0,0 +1,22 @@ +! PR fortran/61234 Warn for use-stmt without explicit only-list. +! { dg-do compile } +! { dg-options "-Wuse-without-only" } +MODULE foo + INTEGER :: bar +END MODULE + +MODULE testmod + USE foo ! { dg-warning "has no ONLY qualifier" } + IMPLICIT NONE +CONTAINS + SUBROUTINE S1 + USE foo ! { dg-warning "has no ONLY qualifier" } + END SUBROUTINE S1 + SUBROUTINE S2 + USE foo, ONLY: bar + END SUBROUTINE + SUBROUTINE S3 + USE ISO_C_BINDING ! { dg-warning "has no ONLY qualifier" } + END SUBROUTINE S3 +END MODULE +! { dg-final { cleanup-modules "foo testmod" } } |