From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10421 invoked by alias); 14 Jul 2002 11:56:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 10401 invoked by uid 71); 14 Jul 2002 11:56:00 -0000 Date: Sun, 14 Jul 2002 04:56:00 -0000 Message-ID: <20020714115600.10399.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: "Rafal Dabrowa" Subject: Re: c++/7008: unexpected error message "var was not declared in this scope" Reply-To: "Rafal Dabrowa" X-SW-Source: 2002-07/txt/msg00442.txt.bz2 List-Id: The following reply was made to PR c++/7008; it has been noted by GNATS. From: "Rafal Dabrowa" To: , , , , Cc: Subject: Re: c++/7008: unexpected error message "var was not declared in this scope" Date: Sun, 14 Jul 2002 13:58:10 +0200 I have a few additional remarks about compiler behavior. Compiler should not take a global variable because use of local one is forbidden. This is unclear and confusing people. Compiler should put an error message instead. Consider the following code: const int N = 500; void f(int var) { const int N = 5; struct { char str[N]; } z1; // error: use of local variable is forbidden here struct { char str[::N]; } z2; // global variable used, ok } Also, error text: "var was not declared in this scope" is unclear, too. In my opinion, better is such like "use of local variable is not allowed here". Rafal Dabrowa