This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH,c++] provide intelligent error messages for missing semicolon after class definition


On Fri, 19 Nov 2010, Nathan Froyd wrote:

> +/* Return true if KEYWORD names a storage class specifier.  */
> +
> +bool
> +keyword_is_storage_class_specifier (enum rid keyword)
> +{
> +  switch (keyword)
> +    {
> +    case RID_CONST:
> +    case RID_VOLATILE:
> +    case RID_INLINE:
> +    case RID_RESTRICT:

Not storage class specifiers in C (const, volatile and restrict are type 
qualifiers, inline is a function specifier).  However, typedef is a 
storage class specifier in C.  And so in C1X is _Thread_local - I imagine 
we'll end up making both __thread and _Thread_local use RID_THREAD and 
having GCC accept all the cases that are valid according to C1X (plus any 
other existing GNU cases unless -pedantic) rather than having distinct 
rules for the two spellings.

Thus, if the definitions of storage class specifiers for C and C++ are 
incompatible I don't think this belongs in c-common.c - or maybe the 
function should be renamed and the comment adjusted to reflect the actual 
rules for the set of keywords included.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]