aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-03-08 11:46:39 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-03-08 11:46:39 +0100
commit1db01ff96aa5ce5c4ad78313d342cf70f923b40c (patch)
treefae09df731b30ee508d5a37f95a71ca30d15912d /gcc/cp/decl2.c
parent94ec37a909697bbf29db73278c77621ccdf60693 (diff)
downloadgcc-1db01ff96aa5ce5c4ad78313d342cf70f923b40c.zip
gcc-1db01ff96aa5ce5c4ad78313d342cf70f923b40c.tar.gz
gcc-1db01ff96aa5ce5c4ad78313d342cf70f923b40c.tar.bz2
re PR tree-optimization/89550 (Spurious array-bounds warning when using __PRETTY_FUNCTION__ as a string_view)
PR tree-optimization/89550 * builtins.c (c_strlen): Only set TREE_NO_WARNING if warning_at returned true. Formatting fixes. (expand_builtin_strnlen): Formatting fixes. * tree-vrp.c (vrp_prop::check_mem_ref): Only set TREE_NO_WARNING if warning_at returned true. * tree-cfg.c (pass_warn_function_return::execute): Likewise. c-family/ * c-common.c (c_common_truthvalue_conversion): Only set TREE_NO_WARNING if warning_at returned true. * c-warn.c (overflow_warning, warn_logical_operator): Likewise. c/ * c-decl.c (finish_function): Only set TREE_NO_WARNING if warning_at returned true. (c_write_global_declarations_1): Only set TREE_NO_WARNING if pedwarn or warning returned true. cp/ * semantics.c (maybe_convert_cond): Only set TREE_NO_WARNING if warning_at returned true. * decl2.c (c_parse_final_cleanups): Likewise. * typeck.c (convert_for_assignment): Likewise. * decl.c (finish_function): Likewise. From-SVN: r269485
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index b60110a..4e4746e 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -5022,13 +5022,11 @@ c_parse_final_cleanups (void)
/* Don't complain if the template was defined. */
&& !(DECL_TEMPLATE_INSTANTIATION (decl)
&& DECL_INITIAL (DECL_TEMPLATE_RESULT
- (template_for_substitution (decl)))))
- {
- warning_at (DECL_SOURCE_LOCATION (decl), 0,
- "inline function %qD used but never defined", decl);
- /* Avoid a duplicate warning from check_global_declaration. */
- TREE_NO_WARNING (decl) = 1;
- }
+ (template_for_substitution (decl))))
+ && warning_at (DECL_SOURCE_LOCATION (decl), 0,
+ "inline function %qD used but never defined", decl))
+ /* Avoid a duplicate warning from check_global_declaration. */
+ TREE_NO_WARNING (decl) = 1;
}
/* So must decls that use a type with no linkage. */