From: Christoph Mallon Date: Mon, 27 Oct 2008 10:50:48 +0000 (+0000) Subject: C++ has not "tentative definitions". X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=82a16d87e8e49e9338c2c890fca65a831aeef94d;p=cparser C++ has not "tentative definitions". [r23222] --- 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);