diff options
author | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2019-11-23 06:33:59 +0000 |
---|---|---|
committer | Bernd Edlinger <edlinger@gcc.gnu.org> | 2019-11-23 06:33:59 +0000 |
commit | 41149acaff5ccb046ebf8ac7ae6eadb147f6f6b8 (patch) | |
tree | 62a7fdefd6834956d800987e955be3c71cadce9b | |
parent | f34a05b0d3499567b24273739c7cca41c115aa7b (diff) | |
download | gcc-41149acaff5ccb046ebf8ac7ae6eadb147f6f6b8.zip gcc-41149acaff5ccb046ebf8ac7ae6eadb147f6f6b8.tar.gz gcc-41149acaff5ccb046ebf8ac7ae6eadb147f6f6b8.tar.bz2 |
re PR c++/92365 (ice unexpected expression ‘int16_t()’ of kind cast_expr)
PR c++/92365
2019-11-22 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR c++/92365
* name-lookup.c (check_local_shadow): Use can_convert_arg
instead of can_convert.
testsuite:
2019-11-22 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR c++/92365
* g++.dg/pr92365.C: New test.
From-SVN: r278639
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/name-lookup.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/pr92365.C | 12 |
4 files changed, 25 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 444b339..33e2cfe 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2019-11-23 Bernd Edlinger <bernd.edlinger@hotmail.de> + + PR c++/92365 + * name-lookup.c (check_local_shadow): Use can_convert_arg + instead of can_convert. + 2019-11-22 Marek Polacek <polacek@redhat.com> PR c++/88337 - P1327R1: Allow polymorphic typeid in constexpr. diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index b399b4e..a298b61 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -2769,8 +2769,8 @@ check_local_shadow (tree decl) (now) doing the shadow checking too early. */ && !type_uses_auto (TREE_TYPE (decl)) - && can_convert (TREE_TYPE (old), TREE_TYPE (decl), - tf_none))) + && can_convert_arg (TREE_TYPE (old), TREE_TYPE (decl), + decl, LOOKUP_IMPLICIT, tf_none))) warning_code = OPT_Wshadow_compatible_local; else warning_code = OPT_Wshadow_local; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1109cd6..c34573b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-11-23 Bernd Edlinger <bernd.edlinger@hotmail.de> + + PR c++/92365 + * g++.dg/pr92365.C: New test. + 2019-11-22 Marek Polacek <polacek@redhat.com> PR c++/88337 - P1327R1: Allow polymorphic typeid in constexpr. diff --git a/gcc/testsuite/g++.dg/pr92365.C b/gcc/testsuite/g++.dg/pr92365.C new file mode 100644 index 0000000..2cefd79 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr92365.C @@ -0,0 +1,12 @@ +/* PR c++/92365 */ +/* { dg-options "-std=c++98 -Wshadow=compatible-local" } */ + +class a { +public: + a(char *); +}; +void b() { + a c(0); + if (0) + int c; +} |