[cfe-commits] r55253 - in /cfe/trunk: lib/Parse/ParseObjc.cpp test/SemaObjCXX/ test/SemaObjCXX/reserved-keyword-selectors.mm

Anders Carlsson andersca at mac.com
Sat Aug 23 14:00:01 PDT 2008


Author: andersca
Date: Sat Aug 23 16:00:01 2008
New Revision: 55253

URL: http://llvm.org/viewvc/llvm-project?rev=55253&view=rev
Log:
Reserved C++ words are valid selectors in Objective-C++

Added:
    cfe/trunk/test/SemaObjCXX/
    cfe/trunk/test/SemaObjCXX/reserved-keyword-selectors.mm
Modified:
    cfe/trunk/lib/Parse/ParseObjc.cpp

Modified: cfe/trunk/lib/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=55253&r1=55252&r2=55253&view=diff

==============================================================================
--- cfe/trunk/lib/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/lib/Parse/ParseObjc.cpp Sat Aug 23 16:00:01 2008
@@ -447,45 +447,74 @@
   default:
     return 0;
   case tok::identifier:
-  case tok::kw_typeof:
-  case tok::kw___alignof:
+  case tok::kw_asm:
   case tok::kw_auto:
-  case tok::kw_break:                    
-  case tok::kw_case:                        
-  case tok::kw_char:                        
-  case tok::kw_const:                       
-  case tok::kw_continue:                    
-  case tok::kw_default:                     
-  case tok::kw_do:                          
-  case tok::kw_double:                      
-  case tok::kw_else:                        
-  case tok::kw_enum:                        
-  case tok::kw_extern:                      
-  case tok::kw_float:                       
-  case tok::kw_for:                         
-  case tok::kw_goto:                        
-  case tok::kw_if:                       
-  case tok::kw_inline:                     
-  case tok::kw_int:                         
-  case tok::kw_long:                        
-  case tok::kw_register:                    
-  case tok::kw_restrict:
-  case tok::kw_return:                      
-  case tok::kw_short:                       
-  case tok::kw_signed:                      
-  case tok::kw_sizeof:                      
-  case tok::kw_static:                      
-  case tok::kw_struct:                      
-  case tok::kw_switch:                      
-  case tok::kw_typedef:                     
-  case tok::kw_union:                       
-  case tok::kw_unsigned:                    
-  case tok::kw_void:                        
-  case tok::kw_volatile:                    
-  case tok::kw_while:                       
   case tok::kw_bool:
+  case tok::kw_break:
+  case tok::kw_case:
+  case tok::kw_catch:
+  case tok::kw_char:
+  case tok::kw_class:
+  case tok::kw_const:
+  case tok::kw_const_cast:
+  case tok::kw_continue:
+  case tok::kw_default:
+  case tok::kw_delete:
+  case tok::kw_do:
+  case tok::kw_double:
+  case tok::kw_dynamic_cast:
+  case tok::kw_else:
+  case tok::kw_enum:
+  case tok::kw_explicit:
+  case tok::kw_export:
+  case tok::kw_extern:
+  case tok::kw_false:
+  case tok::kw_float:
+  case tok::kw_for:
+  case tok::kw_friend:
+  case tok::kw_goto:
+  case tok::kw_if:
+  case tok::kw_inline:
+  case tok::kw_int:
+  case tok::kw_long:
+  case tok::kw_mutable:
+  case tok::kw_namespace:
+  case tok::kw_new:
+  case tok::kw_operator:
+  case tok::kw_private:
+  case tok::kw_protected:
+  case tok::kw_public:
+  case tok::kw_register:
+  case tok::kw_reinterpret_cast:
+  case tok::kw_restrict:
+  case tok::kw_return:
+  case tok::kw_short:
+  case tok::kw_signed:
+  case tok::kw_sizeof:
+  case tok::kw_static:
+  case tok::kw_static_cast:
+  case tok::kw_struct:
+  case tok::kw_switch:
+  case tok::kw_template:
+  case tok::kw_this:
+  case tok::kw_throw:
+  case tok::kw_true:
+  case tok::kw_try:
+  case tok::kw_typedef:
+  case tok::kw_typeid:
+  case tok::kw_typename:
+  case tok::kw_typeof:
+  case tok::kw_union:
+  case tok::kw_unsigned:
+  case tok::kw_using:
+  case tok::kw_virtual:
+  case tok::kw_void:
+  case tok::kw_volatile:
+  case tok::kw_wchar_t:
+  case tok::kw_while:
   case tok::kw__Bool:
   case tok::kw__Complex:
+  case tok::kw___alignof:
     IdentifierInfo *II = Tok.getIdentifierInfo();
     SelectorLoc = ConsumeToken();
     return II;

Added: cfe/trunk/test/SemaObjCXX/reserved-keyword-selectors.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjCXX/reserved-keyword-selectors.mm?rev=55253&view=auto

==============================================================================
--- cfe/trunk/test/SemaObjCXX/reserved-keyword-selectors.mm (added)
+++ cfe/trunk/test/SemaObjCXX/reserved-keyword-selectors.mm Sat Aug 23 16:00:01 2008
@@ -0,0 +1,35 @@
+// RUN: clang -fsyntax-only -verify %s
+
+ at interface A 
+- (void)asm;
+- (void)bool;
+- (void)catch;
+- (void)class;
+- (void)const_cast;
+- (void)delete;
+- (void)dynamic_cast;
+- (void)explicit;
+- (void)export;
+- (void)false;      
+- (void)friend;
+- (void)mutable;
+- (void)namespace;
+- (void)new;
+- (void)operator;
+- (void)private;
+- (void)protected;
+- (void)public;
+- (void)reinterpret_cast;
+- (void)static_cast;
+- (void)template;
+- (void)this;
+- (void)throw;
+- (void)true;
+- (void)try;
+- (void)typename;
+- (void)typeid;
+- (void)using;
+- (void)virtual;
+- (void)wchar_t;
+ at end
+





More information about the cfe-commits mailing list