From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11653 invoked by alias); 4 Aug 2008 23:03:38 -0000 Received: (qmail 11639 invoked by uid 22791); 4 Aug 2008 23:03:36 -0000 X-Spam-Check-By: sourceware.org Received: from mail-in-16.arcor-online.net (HELO mail-in-16.arcor-online.net) (151.189.21.56) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 04 Aug 2008 23:02:53 +0000 Received: from mail-in-07-z2.arcor-online.net (mail-in-07-z2.arcor-online.net [151.189.8.19]) by mail-in-16.arcor-online.net (Postfix) with ESMTP id AD46B1F719B for ; Tue, 5 Aug 2008 01:02:50 +0200 (CEST) Received: from mail-in-13.arcor-online.net (mail-in-13.arcor-online.net [151.189.21.53]) by mail-in-07-z2.arcor-online.net (Postfix) with ESMTP id 99C302C6BBF for ; Tue, 5 Aug 2008 01:02:50 +0200 (CEST) Received: from [192.168.2.28] (dslb-084-059-127-174.pools.arcor-ip.net [84.59.127.174]) (Authenticated sender: a.werth@arcor.de) by mail-in-13.arcor-online.net (Postfix) with ESMTP id 6C69D23D1E4 for ; Tue, 5 Aug 2008 01:02:50 +0200 (CEST) Subject: namespace and class within with similar name From: Alexander Werth To: gcc-help@gcc.gnu.org Content-Type: text/plain; charset=UTF-8 Date: Mon, 04 Aug 2008 23:03:00 -0000 Message-Id: <1217890908.21247.17.camel@Jiminy> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 8bit X-Virus-Status: Clean Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-08/txt/msg00038.txt.bz2 Hi, I have the following code and I wonder why C++ complains. namespace S { class L; class S; } using namespace S; class C { void m(::S::L *l) {}; }; $ g++ main.5.cpp main.5.cpp:12: error: ‘struct S::S::L’ has not been declared Shouldn't it be clear that I wan't to access class L in namespace S and not some L of class S in namespace S ? Couriously I only get this error on some compilers: gcc 4.1 and gcc 4.2.3 produce this error while gcc 3.2.2 and xlc work as expected. Any idea besides complaining about why I want to do this at all ? ;) Alexander