From 82a16d87e8e49e9338c2c890fca65a831aeef94d Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Mon, 27 Oct 2008 10:50:48 +0000 Subject: [PATCH] C++ has not "tentative definitions". [r23222] --- parser.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/parser.c b/parser.c index 09accea..6fb2c81 100644 --- a/parser.c +++ b/parser.c @@ -4774,10 +4774,14 @@ warn_redundant_declaration: previous_declaration->storage_class = STORAGE_CLASS_NONE; previous_declaration->declared_storage_class = STORAGE_CLASS_NONE; } else { + /* ISO/IEC 14882:1998(E) §C.1.2:1 */ + if (c_mode & _CXX) + goto error_redeclaration; goto warn_redundant_declaration; } } else if (is_type_valid(prev_type)) { if (old_storage_class == new_storage_class) { +error_redeclaration: errorf(&declaration->source_position, "redeclaration of '%Y' (declared %P)", symbol, &previous_declaration->source_position); -- 2.20.1