From: Shriramana Sharma <samjnaa@gmail.com>
To: Linux C Programming List <linux-c-programming@vger.kernel.org>
Subject: synonymous error messages?
Date: Thu, 24 May 2007 12:40:33 +0530 [thread overview]
Message-ID: <46553A69.9000409@gmail.com> (raw)
g++ -c on the following code fragment:
void f ( void ) {
class Local {
static int j ;
} ;
}
gives the following errors:
static-member-in-local-class.cpp: In function ‘void f()’:
static-member-in-local-class.cpp:3: error: local class ‘class
f()::Local’ shall not have static data member ‘int f()::Local::j’
static-member-in-local-class.cpp:3: error: field ‘f()::Local::j’ in
local class cannot be static
I understand that local classes cannot have static members because it is
not possible to describe the data member at file scope in order to
define it.
But what is the difference between "local class shall not have static
data member" and "field in local class cannot be static"?
Thanks as always.
Shriramana Sharma.
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
reply other threads:[~2007-05-24 7:10 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46553A69.9000409@gmail.com \
--to=samjnaa@gmail.com \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).