linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* synonymous error messages?
@ 2007-05-24  7:10 Shriramana Sharma
  0 siblings, 0 replies; only message in thread
From: Shriramana Sharma @ 2007-05-24  7:10 UTC (permalink / raw)
  To: Linux C Programming List

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-05-24  7:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-24  7:10 synonymous error messages? Shriramana Sharma

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).