[cfe-commits] r163032 - in /cfe/trunk: include/clang-c/Index.h include/clang/AST/DeclCXX.h include/clang/Basic/DiagnosticASTKinds.td include/clang/Basic/DiagnosticParseKinds.td include/clang/Basic/DiagnosticSemaKinds.td include/clang/Basic/Specifiers.h lib/AST/DeclCXX.cpp lib/AST/MicrosoftMangle.cpp lib/CodeGen/CGDebugInfo.cpp lib/Parse/ParseDeclCXX.cpp lib/Sema/SemaDeclCXX.cpp lib/Serialization/ASTReaderDecl.cpp test/Parser/MicrosoftExtensions.cpp tools/libclang/CIndexCXX.cpp tools/libclang/IndexingContext.cpp

Joao Matos ripzonetriton at gmail.com
Fri Aug 31 15:18:20 PDT 2012


Author: triton
Date: Fri Aug 31 17:18:20 2012
New Revision: 163032

URL: http://llvm.org/viewvc/llvm-project?rev=163032&view=rev
Log:
Normalize line endings of r163013 (part 2).

Modified:
    cfe/trunk/include/clang-c/Index.h
    cfe/trunk/include/clang/AST/DeclCXX.h
    cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td
    cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/trunk/include/clang/Basic/Specifiers.h
    cfe/trunk/lib/AST/DeclCXX.cpp
    cfe/trunk/lib/AST/MicrosoftMangle.cpp
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
    cfe/trunk/lib/Parse/ParseDeclCXX.cpp
    cfe/trunk/lib/Sema/SemaDeclCXX.cpp
    cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
    cfe/trunk/test/Parser/MicrosoftExtensions.cpp
    cfe/trunk/tools/libclang/CIndexCXX.cpp
    cfe/trunk/tools/libclang/IndexingContext.cpp

Modified: cfe/trunk/include/clang-c/Index.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/Index.h?rev=163032&r1=163031&r2=163032&view=diff
==============================================================================
--- cfe/trunk/include/clang-c/Index.h (original)
+++ cfe/trunk/include/clang-c/Index.h Fri Aug 31 17:18:20 2012
@@ -4962,14 +4962,14 @@
   CXIdxEntity_CXXStaticVariable     = 19,
   CXIdxEntity_CXXStaticMethod       = 20,
   CXIdxEntity_CXXInstanceMethod     = 21,
-  CXIdxEntity_CXXConstructor        = 22,
-  CXIdxEntity_CXXDestructor         = 23,
-  CXIdxEntity_CXXConversionFunction = 24,
-  CXIdxEntity_CXXTypeAlias          = 25,
-  CXIdxEntity_CXXInterface          = 26
-
-} CXIdxEntityKind;
-
+  CXIdxEntity_CXXConstructor        = 22,
+  CXIdxEntity_CXXDestructor         = 23,
+  CXIdxEntity_CXXConversionFunction = 24,
+  CXIdxEntity_CXXTypeAlias          = 25,
+  CXIdxEntity_CXXInterface          = 26
+
+} CXIdxEntityKind;
+
 typedef enum {
   CXIdxEntityLang_None = 0,
   CXIdxEntityLang_C    = 1,

Modified: cfe/trunk/include/clang/AST/DeclCXX.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclCXX.h?rev=163032&r1=163031&r2=163032&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclCXX.h (original)
+++ cfe/trunk/include/clang/AST/DeclCXX.h Fri Aug 31 17:18:20 2012
@@ -1553,15 +1553,15 @@
   bool isVolatile() { return getType()->castAs<FunctionType>()->isVolatile(); }
 
   bool isVirtual() const {
-    CXXMethodDecl *CD =
-      cast<CXXMethodDecl>(const_cast<CXXMethodDecl*>(this)->getCanonicalDecl());
-
-    // Methods declared in interfaces are automatically (pure) virtual
-    if (CD->isVirtualAsWritten() ||
-        CD->getParent()->getTagKind() == TTK_Interface)
-      return true;
-
-    return (CD->begin_overridden_methods() != CD->end_overridden_methods());
+    CXXMethodDecl *CD =
+      cast<CXXMethodDecl>(const_cast<CXXMethodDecl*>(this)->getCanonicalDecl());
+
+    // Methods declared in interfaces are automatically (pure) virtual
+    if (CD->isVirtualAsWritten() ||
+        CD->getParent()->getTagKind() == TTK_Interface)
+      return true;
+
+    return (CD->begin_overridden_methods() != CD->end_overridden_methods());
   }
 
   /// \brief Determine whether this is a usual deallocation function

Modified: cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td?rev=163032&r1=163031&r2=163032&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticASTKinds.td Fri Aug 31 17:18:20 2012
@@ -134,13 +134,13 @@
 def err_odr_function_type_inconsistent : Error<
   "external function %0 declared with incompatible types in different "
   "translation units (%1 vs. %2)">;
-def warn_odr_tag_type_inconsistent : Warning<
-  "type %0 has incompatible definitions in different translation units">;
-def note_odr_tag_kind_here: Note<
-  "%0 is a %select{struct|interface|union|class|enum}1 here">;
-def note_odr_field : Note<"field %0 has type %1 here">;
-def note_odr_missing_field : Note<"no corresponding field here">;
-def note_odr_bit_field : Note<"bit-field %0 with type %1 and length %2 here">;
+def warn_odr_tag_type_inconsistent : Warning<
+  "type %0 has incompatible definitions in different translation units">;
+def note_odr_tag_kind_here: Note<
+  "%0 is a %select{struct|interface|union|class|enum}1 here">;
+def note_odr_field : Note<"field %0 has type %1 here">;
+def note_odr_missing_field : Note<"no corresponding field here">;
+def note_odr_bit_field : Note<"bit-field %0 with type %1 and length %2 here">;
 def note_odr_not_bit_field : Note<"field %0 is not a bit-field">;
 def note_odr_base : Note<"class has base type %0">;
 def note_odr_virtual_base : Note<

Modified: cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td?rev=163032&r1=163031&r2=163032&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td Fri Aug 31 17:18:20 2012
@@ -573,13 +573,13 @@
 def err_typename_refers_to_non_type_template : Error<
   "typename specifier refers to a non-template">;
 def err_expected_type_name_after_typename : Error<
-  "expected an identifier or template-id after '::'">;
-def err_explicit_spec_non_template : Error<
-  "explicit %select{specialization|instantiation}0 of non-template "
-  "%select{class|struct|union|interface}1 %2">;
-  
-def err_default_template_template_parameter_not_template : Error<
-  "default template argument for a template template parameter must be a class "
+  "expected an identifier or template-id after '::'">;
+def err_explicit_spec_non_template : Error<
+  "explicit %select{specialization|instantiation}0 of non-template "
+  "%select{class|struct|union|interface}1 %2">;
+  
+def err_default_template_template_parameter_not_template : Error<
+  "default template argument for a template template parameter must be a class "
   "template">;
   
 def err_ctor_init_missing_comma : Error<

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=163032&r1=163031&r2=163032&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Fri Aug 31 17:18:20 2012
@@ -793,17 +793,17 @@
   "friends cannot be members of the declaring class">;
 def warn_cxx98_compat_friend_is_member : Warning<
   "friend declaration naming a member of the declaring class is incompatible "
-  "with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
-def ext_unelaborated_friend_type : ExtWarn<
-  "unelaborated friend declaration is a C++11 extension; specify "
-  "'%select{struct|interface|union|class|enum}0' to befriend %1">,
-  InGroup<CXX11>;
-def warn_cxx98_compat_unelaborated_friend_type : Warning<
-  "befriending %1 without '%select{struct|interface|union|class|enum}0' "
-  "keyword is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
-def err_qualified_friend_not_found : Error<
-  "no function named %0 with type %1 was found in the specified scope">;
-def err_introducing_special_friend : Error<
+  "with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
+def ext_unelaborated_friend_type : ExtWarn<
+  "unelaborated friend declaration is a C++11 extension; specify "
+  "'%select{struct|interface|union|class|enum}0' to befriend %1">,
+  InGroup<CXX11>;
+def warn_cxx98_compat_unelaborated_friend_type : Warning<
+  "befriending %1 without '%select{struct|interface|union|class|enum}0' "
+  "keyword is incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
+def err_qualified_friend_not_found : Error<
+  "no function named %0 with type %1 was found in the specified scope">;
+def err_introducing_special_friend : Error<
   "must use a qualified name when declaring a %select{constructor|"
   "destructor|conversion operator}0 as a friend">;
 def err_tagless_friend_type_template : Error<
@@ -1115,14 +1115,14 @@
 def err_constructor_return_type : Error<
   "constructor cannot have a return type">;
 def err_constructor_redeclared : Error<"constructor cannot be redeclared">;
-def err_constructor_byvalue_arg : Error<
-  "copy constructor must pass its first argument by reference">;
-def warn_no_constructor_for_refconst : Warning<
-  "%select{struct|interface|union|class|enum}0 %1 does not declare any "
-  "constructor to initialize its non-modifiable members">;
-def note_refconst_member_not_initialized : Note<
-  "%select{const|reference}0 member %1 will never be initialized">;
-def ext_ms_explicit_constructor_call : ExtWarn<
+def err_constructor_byvalue_arg : Error<
+  "copy constructor must pass its first argument by reference">;
+def warn_no_constructor_for_refconst : Warning<
+  "%select{struct|interface|union|class|enum}0 %1 does not declare any "
+  "constructor to initialize its non-modifiable members">;
+def note_refconst_member_not_initialized : Note<
+  "%select{const|reference}0 member %1 will never be initialized">;
+def ext_ms_explicit_constructor_call : ExtWarn<
   "explicit constructor calls are a Microsoft extension">, InGroup<Microsoft>;
 
 // C++ destructors
@@ -1309,16 +1309,16 @@
 def err_illegal_decl_array_of_auto : Error<
   "'%0' declared as array of %1">;
 def err_new_array_of_auto : Error<
-  "cannot allocate array of 'auto'">;
-def err_auto_not_allowed : Error<
-  "'auto' not allowed %select{in function prototype|in non-static struct member"
-  "|in non-static union member|in non-static class member|in interface member"
-  "|in exception declaration|in template parameter|in block literal"
-  "|in template argument|in typedef|in type alias|in function return type"
-  "|here}0">;
-def err_auto_var_requires_init : Error<
-  "declaration of variable %0 with type %1 requires an initializer">;
-def err_auto_new_requires_ctor_arg : Error<
+  "cannot allocate array of 'auto'">;
+def err_auto_not_allowed : Error<
+  "'auto' not allowed %select{in function prototype|in non-static struct member"
+  "|in non-static union member|in non-static class member|in interface member"
+  "|in exception declaration|in template parameter|in block literal"
+  "|in template argument|in typedef|in type alias|in function return type"
+  "|here}0">;
+def err_auto_var_requires_init : Error<
+  "declaration of variable %0 with type %1 requires an initializer">;
+def err_auto_new_requires_ctor_arg : Error<
   "new expression for type %0 requires a constructor argument">;
 def err_auto_new_requires_parens : Error<
   "new expression for type %0 cannot use list-initialization">;
@@ -1438,13 +1438,13 @@
   "'constexpr' specifier is incompatible with C++98">,
   InGroup<CXX98Compat>, DefaultIgnore;
 def err_invalid_constexpr : Error<
-  "%select{function parameter|typedef|non-static data member}0 "
-  "cannot be constexpr">;
-def err_constexpr_tag : Error<
-  "%select{class|struct|interface|union|enum}0 cannot be marked constexpr">;
-def err_constexpr_dtor : Error<"destructor cannot be marked constexpr">;
-def err_constexpr_no_declarators : Error<
-  "constexpr can only be used in variable and function declarations">;
+  "%select{function parameter|typedef|non-static data member}0 "
+  "cannot be constexpr">;
+def err_constexpr_tag : Error<
+  "%select{class|struct|interface|union|enum}0 cannot be marked constexpr">;
+def err_constexpr_dtor : Error<"destructor cannot be marked constexpr">;
+def err_constexpr_no_declarators : Error<
+  "constexpr can only be used in variable and function declarations">;
 def err_invalid_constexpr_var_decl : Error<
   "constexpr variable declaration must be a definition">;
 def err_constexpr_static_mem_var_requires_init : Error<
@@ -1456,18 +1456,18 @@
 def err_constexpr_redecl_mismatch : Error<
   "%select{non-constexpr declaration of %0 follows constexpr declaration"
   "|constexpr declaration of %0 follows non-constexpr declaration}1">;
-def err_constexpr_virtual : Error<"virtual function cannot be constexpr">;
-def err_constexpr_virtual_base : Error<
-  "constexpr %select{member function|constructor}0 not allowed in "
-  "%select{struct|interface|class}1 with virtual base "
-  "%plural{1:class|:classes}2">;
-def note_non_literal_incomplete : Note<
-  "incomplete type %0 is not a literal type">;
-def note_non_literal_virtual_base : Note<"%select{struct|interface|class}0 "
-  "with virtual base %plural{1:class|:classes}1 is not a literal type">;
-def note_constexpr_virtual_base_here : Note<"virtual base class declared here">;
-def err_constexpr_non_literal_return : Error<
-  "constexpr function's return type %0 is not a literal type">;
+def err_constexpr_virtual : Error<"virtual function cannot be constexpr">;
+def err_constexpr_virtual_base : Error<
+  "constexpr %select{member function|constructor}0 not allowed in "
+  "%select{struct|interface|class}1 with virtual base "
+  "%plural{1:class|:classes}2">;
+def note_non_literal_incomplete : Note<
+  "incomplete type %0 is not a literal type">;
+def note_non_literal_virtual_base : Note<"%select{struct|interface|class}0 "
+  "with virtual base %plural{1:class|:classes}1 is not a literal type">;
+def note_constexpr_virtual_base_here : Note<"virtual base class declared here">;
+def err_constexpr_non_literal_return : Error<
+  "constexpr function's return type %0 is not a literal type">;
 def err_constexpr_non_literal_param : Error<
   "constexpr %select{function|constructor}1's %ordinal0 parameter type %2 is "
   "not a literal type">;
@@ -1700,15 +1700,15 @@
   "__declspec attribute %0 is not supported">, 
   InGroup<IgnoredAttributes>;
 def warn_attribute_invalid_on_stmt : Warning<
-  "attribute %0 cannot be specified on a statement">,
-  InGroup<IgnoredAttributes>;
-def warn_declspec_attribute_ignored : Warning<
-  "attribute %0 is ignored, place it after "
-  "\"%select{class|struct|union|interface|enum}1\" to apply attribute to "
-  "type declaration">, InGroup<IgnoredAttributes>;
-def warn_attribute_precede_definition : Warning<
-  "attribute declaration must precede definition">,
-  InGroup<IgnoredAttributes>;
+  "attribute %0 cannot be specified on a statement">,
+  InGroup<IgnoredAttributes>;
+def warn_declspec_attribute_ignored : Warning<
+  "attribute %0 is ignored, place it after "
+  "\"%select{class|struct|union|interface|enum}1\" to apply attribute to "
+  "type declaration">, InGroup<IgnoredAttributes>;
+def warn_attribute_precede_definition : Warning<
+  "attribute declaration must precede definition">,
+  InGroup<IgnoredAttributes>;
 def warn_attribute_void_function_method : Warning<
   "attribute %0 cannot be applied to "
   "%select{functions|Objective-C method}1 without return value">,
@@ -3183,31 +3183,31 @@
 def err_tag_reference_non_tag : Error<
   "elaborated type refers to %select{a non-tag type|a typedef|a type alias|a template|a type alias template}0">;
 def err_tag_reference_conflict : Error<
-  "implicit declaration introduced by elaborated type conflicts with "
-  "%select{a declaration|a typedef|a type alias|a template}0 of the same name">;
-def err_dependent_tag_decl : Error<
-  "%select{declaration|definition}0 of "
-  "%select{struct|interface|union|class|enum}1 in a dependent scope">;
-def err_tag_definition_of_typedef : Error<
-  "definition of type %0 conflicts with %select{typedef|type alias}1 of the same name">;
-def err_conflicting_types : Error<"conflicting types for %0">;
+  "implicit declaration introduced by elaborated type conflicts with "
+  "%select{a declaration|a typedef|a type alias|a template}0 of the same name">;
+def err_dependent_tag_decl : Error<
+  "%select{declaration|definition}0 of "
+  "%select{struct|interface|union|class|enum}1 in a dependent scope">;
+def err_tag_definition_of_typedef : Error<
+  "definition of type %0 conflicts with %select{typedef|type alias}1 of the same name">;
+def err_conflicting_types : Error<"conflicting types for %0">;
 def err_nested_redefinition : Error<"nested redefinition of %0">;
-def err_use_with_wrong_tag : Error<
-  "use of %0 with tag type that does not match previous declaration">;
-def warn_struct_class_tag_mismatch : Warning<
-    "%select{struct|interface|class}0%select{| template}1 %2 was previously "
-    "declared as a %select{struct|interface|class}3%select{| template}1">,
-    InGroup<MismatchedTags>, DefaultIgnore;
-def warn_struct_class_previous_tag_mismatch : Warning<
-    "%2 defined as %select{a struct|an interface|a class}0%select{| template}1 "
-    "here but previously declared as "
-    "%select{a struct|an interface|a class}3%select{| template}1">,
-     InGroup<MismatchedTags>, DefaultIgnore;
-def note_struct_class_suggestion : Note<
-    "did you mean %select{struct|interface|class}0 here?">;
-def ext_forward_ref_enum : Extension<
-  "ISO C forbids forward references to 'enum' types">;
-def err_forward_ref_enum : Error<
+def err_use_with_wrong_tag : Error<
+  "use of %0 with tag type that does not match previous declaration">;
+def warn_struct_class_tag_mismatch : Warning<
+    "%select{struct|interface|class}0%select{| template}1 %2 was previously "
+    "declared as a %select{struct|interface|class}3%select{| template}1">,
+    InGroup<MismatchedTags>, DefaultIgnore;
+def warn_struct_class_previous_tag_mismatch : Warning<
+    "%2 defined as %select{a struct|an interface|a class}0%select{| template}1 "
+    "here but previously declared as "
+    "%select{a struct|an interface|a class}3%select{| template}1">,
+     InGroup<MismatchedTags>, DefaultIgnore;
+def note_struct_class_suggestion : Note<
+    "did you mean %select{struct|interface|class}0 here?">;
+def ext_forward_ref_enum : Extension<
+  "ISO C forbids forward references to 'enum' types">;
+def err_forward_ref_enum : Error<
   "ISO C++ forbids forward references to 'enum' types">;
 def ext_ms_forward_ref_enum : Extension<
   "forward references to 'enum' types are a Microsoft extension">, InGroup<Microsoft>;
@@ -3245,19 +3245,19 @@
 def warn_array_new_too_large : Warning<"array is too large (%0 elements)">,
   // FIXME PR11644: ", will throw std::bad_array_new_length at runtime"
   InGroup<DiagGroup<"bad-array-new-length">>;
-
-// -Wpadded, -Wpacked
-def warn_padded_struct_field : Warning<
-  "padding %select{struct|interface|class}0 %1 with %2 "
-  "%select{byte|bit}3%select{|s}4 to align %5">,
-  InGroup<Padded>, DefaultIgnore;
-def warn_padded_struct_anon_field : Warning<
-  "padding %select{struct|interface|class}0 %1 with %2 "
-  "%select{byte|bit}3%select{|s}4 to align anonymous bit-field">,
-  InGroup<Padded>, DefaultIgnore;
-def warn_padded_struct_size : Warning<
-  "padding size of %0 with %1 %select{byte|bit}2%select{|s}3 "
-  "to alignment boundary">, InGroup<Padded>, DefaultIgnore;
+
+// -Wpadded, -Wpacked
+def warn_padded_struct_field : Warning<
+  "padding %select{struct|interface|class}0 %1 with %2 "
+  "%select{byte|bit}3%select{|s}4 to align %5">,
+  InGroup<Padded>, DefaultIgnore;
+def warn_padded_struct_anon_field : Warning<
+  "padding %select{struct|interface|class}0 %1 with %2 "
+  "%select{byte|bit}3%select{|s}4 to align anonymous bit-field">,
+  InGroup<Padded>, DefaultIgnore;
+def warn_padded_struct_size : Warning<
+  "padding size of %0 with %1 %select{byte|bit}2%select{|s}3 "
+  "to alignment boundary">, InGroup<Padded>, DefaultIgnore;
 def warn_unnecessary_packed : Warning<
   "packed attribute is unnecessary for %0">, InGroup<Packed>, DefaultIgnore;
 
@@ -3499,22 +3499,22 @@
 def ext_flexible_array_in_array : Extension<
   "%0 may not be used as an array element due to flexible array member">,
   InGroup<FlexibleArrayExtensions>;
-def err_flexible_array_init : Error<
-  "initialization of flexible array member is not allowed">;
-def ext_flexible_array_empty_aggregate_ms : Extension<
-  "flexible array member %0 in otherwise empty "
-  "%select{struct|interface|union|class|enum}1 is a Microsoft extension">,
-  InGroup<Microsoft>;
-def ext_flexible_array_union_ms : Extension<
-  "flexible array member %0 in a union is a Microsoft extension">,
-  InGroup<Microsoft>;
-def ext_flexible_array_empty_aggregate_gnu : Extension<
-  "flexible array member %0 in otherwise empty "
-  "%select{struct|interface|union|class|enum}1 is a GNU extension">,
-  InGroup<GNU>;
-def ext_flexible_array_union_gnu : Extension<
-  "flexible array member %0 in a union is a GNU extension">, InGroup<GNU>;
-
+def err_flexible_array_init : Error<
+  "initialization of flexible array member is not allowed">;
+def ext_flexible_array_empty_aggregate_ms : Extension<
+  "flexible array member %0 in otherwise empty "
+  "%select{struct|interface|union|class|enum}1 is a Microsoft extension">,
+  InGroup<Microsoft>;
+def ext_flexible_array_union_ms : Extension<
+  "flexible array member %0 in a union is a Microsoft extension">,
+  InGroup<Microsoft>;
+def ext_flexible_array_empty_aggregate_gnu : Extension<
+  "flexible array member %0 in otherwise empty "
+  "%select{struct|interface|union|class|enum}1 is a GNU extension">,
+  InGroup<GNU>;
+def ext_flexible_array_union_gnu : Extension<
+  "flexible array member %0 in a union is a GNU extension">, InGroup<GNU>;
+
 let CategoryName = "ARC Semantic Issue" in {
 
 // ARC-mode diagnostics.
@@ -4594,13 +4594,13 @@
   "because namespace %1 does not enclose namespace %2">;
 def err_invalid_declarator_global_scope : Error<
   "definition or redeclaration of %0 cannot name the global scope">;
-def err_invalid_declarator_in_function : Error<
-  "definition or redeclaration of %0 not allowed inside a function">;
-def err_not_tag_in_scope : Error<
-  "no %select{struct|interface|union|class|enum}0 named %1 in %2">;
-
-def err_no_typeid_with_fno_rtti : Error<
-  "cannot use typeid with -fno-rtti">;
+def err_invalid_declarator_in_function : Error<
+  "definition or redeclaration of %0 not allowed inside a function">;
+def err_not_tag_in_scope : Error<
+  "no %select{struct|interface|union|class|enum}0 named %1 in %2">;
+
+def err_no_typeid_with_fno_rtti : Error<
+  "cannot use typeid with -fno-rtti">;
 
 def err_cannot_form_pointer_to_member_of_reference_type : Error<
   "cannot form a pointer-to-member to member %0 of reference type %1">;
@@ -5945,13 +5945,13 @@
   "%select{template|partial|member}0 specialization cannot be "
   "declared __module_private__">;
 def err_module_private_local : Error<
-  "%select{local variable|parameter|typedef}0 %1 cannot be declared "
-  "__module_private__">;
-def err_module_private_local_class : Error<
-  "local %select{struct|interface|union|class|enum}0 cannot be declared "
-  "__module_private__">;
-def err_module_private_definition : Error<
-  "definition of %0 must be imported before it is required">;
+  "%select{local variable|parameter|typedef}0 %1 cannot be declared "
+  "__module_private__">;
+def err_module_private_local_class : Error<
+  "local %select{struct|interface|union|class|enum}0 cannot be declared "
+  "__module_private__">;
+def err_module_private_definition : Error<
+  "definition of %0 must be imported before it is required">;
 }
 
 let CategoryName = "Documentation Issue" in {

Modified: cfe/trunk/include/clang/Basic/Specifiers.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Specifiers.h?rev=163032&r1=163031&r2=163032&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/Specifiers.h (original)
+++ cfe/trunk/include/clang/Basic/Specifiers.h Fri Aug 31 17:18:20 2012
@@ -50,13 +50,13 @@
     TST_decimal64,    // _Decimal64
     TST_decimal128,   // _Decimal128
     TST_enum,
-    TST_union,
-    TST_struct,
-    TST_class,        // C++ class type
-    TST_interface,    // C++ (Microsoft-specific) __interface type
-    TST_typename,     // Typedef, C++ class-name or enum name, etc.
-    TST_typeofType,
-    TST_typeofExpr,
+    TST_union,
+    TST_struct,
+    TST_class,        // C++ class type
+    TST_interface,    // C++ (Microsoft-specific) __interface type
+    TST_typename,     // Typedef, C++ class-name or enum name, etc.
+    TST_typeofType,
+    TST_typeofExpr,
     TST_decltype,     // C++0x decltype
     TST_underlyingType, // __underlying_type for C++0x
     TST_auto,         // C++0x auto

Modified: cfe/trunk/lib/AST/DeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclCXX.cpp?rev=163032&r1=163031&r2=163032&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclCXX.cpp (original)
+++ cfe/trunk/lib/AST/DeclCXX.cpp Fri Aug 31 17:18:20 2012
@@ -463,14 +463,14 @@
 }
 
 void CXXRecordDecl::addedMember(Decl *D) {
-  if (!D->isImplicit() &&
-      !isa<FieldDecl>(D) &&
-      !isa<IndirectFieldDecl>(D) &&
-      (!isa<TagDecl>(D) || cast<TagDecl>(D)->getTagKind() == TTK_Class ||
-        cast<TagDecl>(D)->getTagKind() == TTK_Interface))
-    data().HasOnlyCMembers = false;
-
-  // Ignore friends and invalid declarations.
+  if (!D->isImplicit() &&
+      !isa<FieldDecl>(D) &&
+      !isa<IndirectFieldDecl>(D) &&
+      (!isa<TagDecl>(D) || cast<TagDecl>(D)->getTagKind() == TTK_Class ||
+        cast<TagDecl>(D)->getTagKind() == TTK_Interface))
+    data().HasOnlyCMembers = false;
+
+  // Ignore friends and invalid declarations.
   if (D->getFriendObjectKind() || D->isInvalidDecl())
     return;
   
@@ -934,14 +934,14 @@
     if (Shadow->getDeclName().getNameKind()
           == DeclarationName::CXXConversionFunctionName)
       data().Conversions.addDecl(Shadow, Shadow->getAccess());
-}
-
-bool CXXRecordDecl::isCLike() const {
-  if (getTagKind() == TTK_Class || getTagKind() == TTK_Interface ||
-      !TemplateOrInstantiation.isNull())
-    return false;
-  if (!hasDefinition())
-    return true;
+}
+
+bool CXXRecordDecl::isCLike() const {
+  if (getTagKind() == TTK_Class || getTagKind() == TTK_Interface ||
+      !TemplateOrInstantiation.isNull())
+    return false;
+  if (!hasDefinition())
+    return true;
 
   return isPOD() && data().HasOnlyCMembers;
 }

Modified: cfe/trunk/lib/AST/MicrosoftMangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/MicrosoftMangle.cpp?rev=163032&r1=163031&r2=163032&view=diff
==============================================================================
--- cfe/trunk/lib/AST/MicrosoftMangle.cpp (original)
+++ cfe/trunk/lib/AST/MicrosoftMangle.cpp Fri Aug 31 17:18:20 2012
@@ -1270,13 +1270,13 @@
 void MicrosoftCXXNameMangler::mangleType(const TagType *T) {
   switch (T->getDecl()->getTagKind()) {
     case TTK_Union:
-      Out << 'T';
-      break;
-    case TTK_Struct:
-    case TTK_Interface:
-      Out << 'U';
-      break;
-    case TTK_Class:
+      Out << 'T';
+      break;
+    case TTK_Struct:
+    case TTK_Interface:
+      Out << 'U';
+      break;
+    case TTK_Class:
       Out << 'V';
       break;
     case TTK_Enum:

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=163032&r1=163031&r2=163032&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Fri Aug 31 17:18:20 2012
@@ -520,13 +520,13 @@
   const CXXRecordDecl *CXXDecl = dyn_cast<CXXRecordDecl>(RD);
   unsigned Tag = 0;
   if (CXXDecl) {
-    RDName = getClassName(RD);
-    Tag = llvm::dwarf::DW_TAG_class_type;
-  }
-  else if (RD->isStruct() || RD->isInterface())
-    Tag = llvm::dwarf::DW_TAG_structure_type;
-  else if (RD->isUnion())
-    Tag = llvm::dwarf::DW_TAG_union_type;
+    RDName = getClassName(RD);
+    Tag = llvm::dwarf::DW_TAG_class_type;
+  }
+  else if (RD->isStruct() || RD->isInterface())
+    Tag = llvm::dwarf::DW_TAG_structure_type;
+  else if (RD->isUnion())
+    Tag = llvm::dwarf::DW_TAG_union_type;
   else
     llvm_unreachable("Unknown RecordDecl type!");
 

Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=163032&r1=163031&r2=163032&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Fri Aug 31 17:18:20 2012
@@ -1031,14 +1031,14 @@
                                  const ParsedTemplateInfo &TemplateInfo,
                                  AccessSpecifier AS, 
                                  bool EnteringContext, DeclSpecContext DSC) {
-  DeclSpec::TST TagType;
-  if (TagTokKind == tok::kw_struct)
-    TagType = DeclSpec::TST_struct;
-  else if (TagTokKind == tok::kw___interface)
-    TagType = DeclSpec::TST_interface;
-  else if (TagTokKind == tok::kw_class)
-    TagType = DeclSpec::TST_class;
-  else {
+  DeclSpec::TST TagType;
+  if (TagTokKind == tok::kw_struct)
+    TagType = DeclSpec::TST_struct;
+  else if (TagTokKind == tok::kw___interface)
+    TagType = DeclSpec::TST_interface;
+  else if (TagTokKind == tok::kw_class)
+    TagType = DeclSpec::TST_class;
+  else {
     assert(TagTokKind == tok::kw_union && "Not a class specifier");
     TagType = DeclSpec::TST_union;
   }
@@ -1150,14 +1150,14 @@
       }
 
       Diag(NameLoc, diag::err_explicit_spec_non_template)
-        << (TemplateInfo.Kind == ParsedTemplateInfo::ExplicitInstantiation)
-        << (TagType == DeclSpec::TST_class? 0
-            : TagType == DeclSpec::TST_struct? 1
-            : TagType == DeclSpec::TST_interface? 2
-            : 3)
-        << Name
-        << SourceRange(LAngleLoc, RAngleLoc);
-
+        << (TemplateInfo.Kind == ParsedTemplateInfo::ExplicitInstantiation)
+        << (TagType == DeclSpec::TST_class? 0
+            : TagType == DeclSpec::TST_struct? 1
+            : TagType == DeclSpec::TST_interface? 2
+            : 3)
+        << Name
+        << SourceRange(LAngleLoc, RAngleLoc);
+
       // Strip off the last template parameter list if it was empty, since
       // we've removed its template argument list.
       if (TemplateParams && TemplateInfo.LastParameterListWasEmpty) {
@@ -1243,13 +1243,13 @@
              (Tok.is(tok::semi) ||
               (Tok.isAtStartOfLine() && !isValidAfterTypeSpecifier(false)))) {
     TUK = DS.isFriendSpecified() ? Sema::TUK_Friend : Sema::TUK_Declaration;
-    if (Tok.isNot(tok::semi)) {
-      // A semicolon was missing after this declaration. Diagnose and recover.
-      ExpectAndConsume(tok::semi, diag::err_expected_semi_after_tagdecl,
-        DeclSpec::getSpecifierName(TagType));
-      PP.EnterToken(Tok);
-      Tok.setKind(tok::semi);
-    }
+    if (Tok.isNot(tok::semi)) {
+      // A semicolon was missing after this declaration. Diagnose and recover.
+      ExpectAndConsume(tok::semi, diag::err_expected_semi_after_tagdecl,
+        DeclSpec::getSpecifierName(TagType));
+      PP.EnterToken(Tok);
+      Tok.setKind(tok::semi);
+    }
   } else
     TUK = Sema::TUK_Reference;
 
@@ -1468,13 +1468,13 @@
   // Also enforce C++ [temp]p3:
   //   In a template-declaration which defines a class, no declarator
   //   is permitted.
-  if (TUK == Sema::TUK_Definition &&
-      (TemplateInfo.Kind || !isValidAfterTypeSpecifier(false))) {
-    ExpectAndConsume(tok::semi, diag::err_expected_semi_after_tagdecl,
-      DeclSpec::getSpecifierName(TagType));
-    // Push this token back into the preprocessor and change our current token
-    // to ';' so that the rest of the code recovers as though there were an
-    // ';' after the definition.
+  if (TUK == Sema::TUK_Definition &&
+      (TemplateInfo.Kind || !isValidAfterTypeSpecifier(false))) {
+    ExpectAndConsume(tok::semi, diag::err_expected_semi_after_tagdecl,
+      DeclSpec::getSpecifierName(TagType));
+    // Push this token back into the preprocessor and change our current token
+    // to ';' so that the rest of the code recovers as though there were an
+    // ';' after the definition.
     PP.EnterToken(Tok);
     Tok.setKind(tok::semi);
   }
@@ -2237,13 +2237,13 @@
 ///         member-declaration member-specification[opt]
 ///         access-specifier ':' member-specification[opt]
 ///
-void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
-                                         unsigned TagType, Decl *TagDecl) {
-  assert((TagType == DeclSpec::TST_struct ||
-         TagType == DeclSpec::TST_interface ||
-         TagType == DeclSpec::TST_union  ||
-         TagType == DeclSpec::TST_class) && "Invalid TagType!");
-
+void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
+                                         unsigned TagType, Decl *TagDecl) {
+  assert((TagType == DeclSpec::TST_struct ||
+         TagType == DeclSpec::TST_interface ||
+         TagType == DeclSpec::TST_union  ||
+         TagType == DeclSpec::TST_class) && "Invalid TagType!");
+
   PrettyDeclStackTraceEntry CrashInfo(Actions, TagDecl, RecordLoc,
                                       "parsing struct/union/class body");
 

Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=163032&r1=163031&r2=163032&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Fri Aug 31 17:18:20 2012
@@ -672,28 +672,28 @@
                                    isa<CXXConstructorDecl>(FD)))
       return false;
   }
-  return true;
-}
-
-/// \brief Get diagnostic %select index for tag kind for
-/// record diagnostic message.
-/// WARNING: Indexes apply to particular diagnostics only!
-///
-/// \returns diagnostic %select index.
-static unsigned getRecordDiagFromTagKind(TagTypeKind Tag)
-{
-  switch (Tag) {
-    case TTK_Struct: return 0;
-    case TTK_Interface: return 1;
-    case TTK_Class:  return 2;
-    default: assert("Invalid tag kind for record diagnostic!");
-  }
-  return -1;
-}
-
-// CheckConstexprFunctionDecl - Check whether a function declaration satisfies
-// the requirements of a constexpr function definition or a constexpr
-// constructor definition. If so, return true. If not, produce appropriate
+  return true;
+}
+
+/// \brief Get diagnostic %select index for tag kind for
+/// record diagnostic message.
+/// WARNING: Indexes apply to particular diagnostics only!
+///
+/// \returns diagnostic %select index.
+static unsigned getRecordDiagFromTagKind(TagTypeKind Tag)
+{
+  switch (Tag) {
+    case TTK_Struct: return 0;
+    case TTK_Interface: return 1;
+    case TTK_Class:  return 2;
+    default: assert("Invalid tag kind for record diagnostic!");
+  }
+  return -1;
+}
+
+// CheckConstexprFunctionDecl - Check whether a function declaration satisfies
+// the requirements of a constexpr function definition or a constexpr
+// constructor definition. If so, return true. If not, produce appropriate
 // diagnostics and return false.
 //
 // This implements C++11 [dcl.constexpr]p3,4, as amended by DR1360.
@@ -704,14 +704,14 @@
     //  The definition of a constexpr constructor shall satisfy the following
     //  constraints:
     //  - the class shall not have any virtual base classes;
-    const CXXRecordDecl *RD = MD->getParent();
-    if (RD->getNumVBases()) {
-      Diag(NewFD->getLocation(), diag::err_constexpr_virtual_base)
-        << isa<CXXConstructorDecl>(NewFD)
-        << getRecordDiagFromTagKind(RD->getTagKind()) << RD->getNumVBases();
-      for (CXXRecordDecl::base_class_const_iterator I = RD->vbases_begin(),
-             E = RD->vbases_end(); I != E; ++I)
-        Diag(I->getLocStart(),
+    const CXXRecordDecl *RD = MD->getParent();
+    if (RD->getNumVBases()) {
+      Diag(NewFD->getLocation(), diag::err_constexpr_virtual_base)
+        << isa<CXXConstructorDecl>(NewFD)
+        << getRecordDiagFromTagKind(RD->getTagKind()) << RD->getNumVBases();
+      for (CXXRecordDecl::base_class_const_iterator I = RD->vbases_begin(),
+             E = RD->vbases_end(); I != E; ++I)
+        Diag(I->getLocStart(),
              diag::note_constexpr_virtual_base_here) << I->getSourceRange();
       return false;
     }

Modified: cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderDecl.cpp?rev=163032&r1=163031&r2=163032&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReaderDecl.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReaderDecl.cpp Fri Aug 31 17:18:20 2012
@@ -1716,16 +1716,16 @@
     return true;
   
   // Compatible tags match.
-  if (TagDecl *TagX = dyn_cast<TagDecl>(X)) {
-    TagDecl *TagY = cast<TagDecl>(Y);
-    return (TagX->getTagKind() == TagY->getTagKind()) ||
-      ((TagX->getTagKind() == TTK_Struct || TagX->getTagKind() == TTK_Class ||
-        TagX->getTagKind() == TTK_Interface) &&
-       (TagY->getTagKind() == TTK_Struct || TagY->getTagKind() == TTK_Class ||
-        TagY->getTagKind() == TTK_Interface));
-  }
-  
-  // Functions with the same type and linkage match.
+  if (TagDecl *TagX = dyn_cast<TagDecl>(X)) {
+    TagDecl *TagY = cast<TagDecl>(Y);
+    return (TagX->getTagKind() == TagY->getTagKind()) ||
+      ((TagX->getTagKind() == TTK_Struct || TagX->getTagKind() == TTK_Class ||
+        TagX->getTagKind() == TTK_Interface) &&
+       (TagY->getTagKind() == TTK_Struct || TagY->getTagKind() == TTK_Class ||
+        TagY->getTagKind() == TTK_Interface));
+  }
+  
+  // Functions with the same type and linkage match.
   // FIXME: This needs to cope with function templates, merging of 
   //prototyped/non-prototyped functions, etc.
   if (FunctionDecl *FuncX = dyn_cast<FunctionDecl>(X)) {

Modified: cfe/trunk/test/Parser/MicrosoftExtensions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/MicrosoftExtensions.cpp?rev=163032&r1=163031&r2=163032&view=diff
==============================================================================
--- cfe/trunk/test/Parser/MicrosoftExtensions.cpp (original)
+++ cfe/trunk/test/Parser/MicrosoftExtensions.cpp Fri Aug 31 17:18:20 2012
@@ -171,27 +171,27 @@
    int k = typename var;// expected-error {{expected a qualified name after 'typename'}}
 }
 
-
-__interface MicrosoftInterface;
-__interface MicrosoftInterface {
-   void foo1() = 0;
-   virtual void foo2() = 0;
-};
-
-__interface MicrosoftDerivedInterface : public MicrosoftInterface {
-  void foo1();
-  void foo2() override;
-  void foo3();
-};
-
-void interface_test() {
-  MicrosoftInterface* a;
-  a->foo1();
-  MicrosoftDerivedInterface* b;
-  b->foo2();
-}
-
-__int64 x7 = __int64(0);
+
+__interface MicrosoftInterface;
+__interface MicrosoftInterface {
+   void foo1() = 0;
+   virtual void foo2() = 0;
+};
+
+__interface MicrosoftDerivedInterface : public MicrosoftInterface {
+  void foo1();
+  void foo2() override;
+  void foo3();
+};
+
+void interface_test() {
+  MicrosoftInterface* a;
+  a->foo1();
+  MicrosoftDerivedInterface* b;
+  b->foo2();
+}
+
+__int64 x7 = __int64(0);
 
 
 namespace If_exists_test {
@@ -238,29 +238,29 @@
 
 int __if_exists_init_list() {
 
-  int array1[] = {
-    0, 
-    __if_exists(IF_EXISTS::Type) {2, }
-    3
-  };
-
-  int array2[] = {
-    0, 
-    __if_exists(IF_EXISTS::Type_not) { this wont compile }
-    3
-  };
-
-  int array3[] = {
-    0, 
-    __if_not_exists(IF_EXISTS::Type_not) {2, }
-    3
-  };
-
-  int array4[] = {
-    0, 
-    __if_not_exists(IF_EXISTS::Type) { this wont compile }
-    3
-  };
+  int array1[] = {
+    0, 
+    __if_exists(IF_EXISTS::Type) {2, }
+    3
+  };
+
+  int array2[] = {
+    0, 
+    __if_exists(IF_EXISTS::Type_not) { this wont compile }
+    3
+  };
+
+  int array3[] = {
+    0, 
+    __if_not_exists(IF_EXISTS::Type_not) {2, }
+    3
+  };
+
+  int array4[] = {
+    0, 
+    __if_not_exists(IF_EXISTS::Type) { this wont compile }
+    3
+  };
 
 }
 

Modified: cfe/trunk/tools/libclang/CIndexCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndexCXX.cpp?rev=163032&r1=163031&r2=163032&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndexCXX.cpp (original)
+++ cfe/trunk/tools/libclang/CIndexCXX.cpp Fri Aug 31 17:18:20 2012
@@ -64,15 +64,15 @@
       
   case CXCursor_ClassTemplatePartialSpecialization:
     if (ClassTemplateSpecializationDecl *PartialSpec
-          = dyn_cast_or_null<ClassTemplatePartialSpecializationDecl>(
-                                                            getCursorDecl(C))) {
-      switch (PartialSpec->getTagKind()) {
-      case TTK_Interface:
-      case TTK_Struct: return CXCursor_StructDecl;
-      case TTK_Class: return CXCursor_ClassDecl;
-      case TTK_Union: return CXCursor_UnionDecl;
-      case TTK_Enum: return CXCursor_NoDeclFound;
-      }
+          = dyn_cast_or_null<ClassTemplatePartialSpecializationDecl>(
+                                                            getCursorDecl(C))) {
+      switch (PartialSpec->getTagKind()) {
+      case TTK_Interface:
+      case TTK_Struct: return CXCursor_StructDecl;
+      case TTK_Class: return CXCursor_ClassDecl;
+      case TTK_Union: return CXCursor_UnionDecl;
+      case TTK_Enum: return CXCursor_NoDeclFound;
+      }
     }
     break;
       

Modified: cfe/trunk/tools/libclang/IndexingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/IndexingContext.cpp?rev=163032&r1=163031&r2=163032&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/IndexingContext.cpp (original)
+++ cfe/trunk/tools/libclang/IndexingContext.cpp Fri Aug 31 17:18:20 2012
@@ -852,16 +852,16 @@
     case TTK_Union:
       EntityInfo.kind = CXIdxEntity_Union; break;
     case TTK_Class:
-      EntityInfo.kind = CXIdxEntity_CXXClass;
-      EntityInfo.lang = CXIdxEntityLang_CXX;
-      break;
-    case TTK_Interface:
-      EntityInfo.kind = CXIdxEntity_CXXInterface;
-      EntityInfo.lang = CXIdxEntityLang_CXX;
-      break;
-    case TTK_Enum:
-      EntityInfo.kind = CXIdxEntity_Enum; break;
-    }
+      EntityInfo.kind = CXIdxEntity_CXXClass;
+      EntityInfo.lang = CXIdxEntityLang_CXX;
+      break;
+    case TTK_Interface:
+      EntityInfo.kind = CXIdxEntity_CXXInterface;
+      EntityInfo.lang = CXIdxEntityLang_CXX;
+      break;
+    case TTK_Enum:
+      EntityInfo.kind = CXIdxEntity_Enum; break;
+    }
 
     if (const CXXRecordDecl *CXXRec = dyn_cast<CXXRecordDecl>(D))
       if (!CXXRec->isCLike())





More information about the cfe-commits mailing list