<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Feb 22, 2013 at 9:15 AM, Michael Han <span dir="ltr"><<a href="mailto:fragmentshaders@gmail.com" target="_blank">fragmentshaders@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Author: hanm<br>
Date: Fri Feb 22 11:15:32 2013<br>
New Revision: 175900<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=175900&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=175900&view=rev</a><br>
Log:<br>
[Sema] Semantic analysis for empty-declaration and attribute-declaration.<br>
<br>
Introduce a new AST Decl node "EmptyDecl" to model empty-declaration. Have attributes from attribute-declaration appertain<br>
to the EmptyDecl node by creating the AST representations of these attributes and attach them to the EmptyDecl node so these<br>
attributes can be sema checked just as attributes attached to "normal" declarations.<br>
<br>
<br>
Modified:<br>
    cfe/trunk/include/clang/AST/Decl.h<br>
    cfe/trunk/include/clang/AST/RecursiveASTVisitor.h<br>
    cfe/trunk/include/clang/Basic/DeclNodes.td<br>
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td<br>
    cfe/trunk/include/clang/Sema/Sema.h<br>
    cfe/trunk/include/clang/Serialization/ASTBitCodes.h<br>
    cfe/trunk/lib/AST/Decl.cpp<br>
    cfe/trunk/lib/AST/DeclBase.cpp<br>
    cfe/trunk/lib/AST/DeclPrinter.cpp<br>
    cfe/trunk/lib/CodeGen/CGDecl.cpp<br>
    cfe/trunk/lib/CodeGen/CodeGenModule.cpp<br>
    cfe/trunk/lib/Parse/Parser.cpp<br>
    cfe/trunk/lib/Sema/SemaDeclCXX.cpp<br>
    cfe/trunk/lib/Serialization/ASTCommon.cpp<br>
    cfe/trunk/lib/Serialization/ASTReaderDecl.cpp<br>
    cfe/trunk/lib/Serialization/ASTWriterDecl.cpp<br>
    cfe/trunk/test/Parser/cxx0x-attributes.cpp<br>
    cfe/trunk/test/SemaCXX/cxx11-ast-print.cpp<br>
    cfe/trunk/tools/libclang/RecursiveASTVisitor.h<br>
<br>
Modified: cfe/trunk/include/clang/AST/Decl.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Decl.h?rev=175900&r1=175899&r2=175900&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Decl.h?rev=175900&r1=175899&r2=175900&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/include/clang/AST/Decl.h (original)<br>
+++ cfe/trunk/include/clang/AST/Decl.h Fri Feb 22 11:15:32 2013<br>
@@ -3297,7 +3297,21 @@ public:<br>
   static bool classof(const Decl *D) { return classofKind(D->getKind()); }<br>
   static bool classofKind(Kind K) { return K == Import; }<br>
 };<br>
-<br>
+<br>
+/// \brief Represents an empty-declaration.<br>
+class EmptyDecl : public Decl {<br>
+  virtual void anchor();<br>
+  EmptyDecl(DeclContext *DC, SourceLocation L)<br>
+    : Decl(Empty, DC, L) { }<br>
+<br>
+public:<br>
+  static EmptyDecl *Create(ASTContext &C, DeclContext *DC,<br>
+                           SourceLocation L);<br>
+  static EmptyDecl *CreateDeserialized(ASTContext &C, unsigned ID);<br>
+<br>
+  static bool classof(const Decl *D) { return classofKind(D->getKind()); }<br>
+  static bool classofKind(Kind K) { return K == Empty; }<br>
+};<br>
<br>
 /// Insertion operator for diagnostics.  This allows sending NamedDecl's<br>
 /// into a diagnostic with <<.<br>
<br>
Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=175900&r1=175899&r2=175900&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=175900&r1=175899&r2=175900&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/include/clang/AST/RecursiveASTVisitor.h (original)<br>
+++ cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Fri Feb 22 11:15:32 2013<br>
@@ -1257,6 +1257,8 @@ DEF_TRAVERSE_DECL(BlockDecl, {<br>
     return true;<br>
   })<br>
<br>
+DEF_TRAVERSE_DECL(EmptyDecl, { })<br></blockquote><div><br></div><div style>This breaks the -Werror build of libclang:<br><br><div>llvm/src/tools/clang/tools/libclang/CIndex.cpp:4428:11: error: enumeration value 'Empty' not handled in switch [-Werror,-Wswitch]</div>
<div>  switch (D->getKind()) {</div><div>          ^</div><div><br></div><div style>I've 'fixed' (more like suppressed) this in r175902 - could you take a look & correct this as appropriate? (maybe add a libclang test? Not sure how that code is tested)<br>
<br>- David</div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
+<br>
 DEF_TRAVERSE_DECL(FileScopeAsmDecl, {<br>
     TRY_TO(TraverseStmt(D->getAsmString()));<br>
   })<br>
<br>
Modified: cfe/trunk/include/clang/Basic/DeclNodes.td<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DeclNodes.td?rev=175900&r1=175899&r2=175900&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DeclNodes.td?rev=175900&r1=175899&r2=175900&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/include/clang/Basic/DeclNodes.td (original)<br>
+++ cfe/trunk/include/clang/Basic/DeclNodes.td Fri Feb 22 11:15:32 2013<br>
@@ -74,4 +74,5 @@ def StaticAssert : Decl;<br>
 def Block : Decl, DeclContext;<br>
 def ClassScopeFunctionSpecialization : Decl;<br>
 def Import : Decl;<br>
+def Empty : Decl;<br>
<br>
<br>
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=175900&r1=175899&r2=175900&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=175900&r1=175899&r2=175900&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)<br>
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Fri Feb 22 11:15:32 2013<br>
@@ -1916,8 +1916,6 @@ def warn_attribute_not_on_decl : Warning<br>
   "%0 attribute ignored when parsing type">, InGroup<IgnoredAttributes>;<br>
 def err_base_specifier_attribute : Error<<br>
   "%0 attribute cannot be applied to a base specifier">;<br>
-def err_attribute_declaration : Error<<br>
-  "%0 attribute cannot be used in an attribute declaration">;<br>
<br>
 // Availability attribute<br>
 def warn_availability_unknown_platform : Warning<<br>
<br>
Modified: cfe/trunk/include/clang/Sema/Sema.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=175900&r1=175899&r2=175900&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=175900&r1=175899&r2=175900&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/include/clang/Sema/Sema.h (original)<br>
+++ cfe/trunk/include/clang/Sema/Sema.h Fri Feb 22 11:15:32 2013<br>
@@ -1447,8 +1447,10 @@ public:<br>
                               SourceLocation AsmLoc,<br>
                               SourceLocation RParenLoc);<br>
<br>
-  /// \brief Handle a C++11 attribute-declaration.<br>
-  void ActOnAttributeDeclaration(AttributeList *AttrList);<br>
+  /// \brief Handle a C++11 empty-declaration and attribute-declaration.<br>
+  Decl *ActOnEmptyDeclaration(Scope *S,<br>
+                              AttributeList *AttrList,<br>
+                              SourceLocation SemiLoc);<br>
<br>
   /// \brief The parser has processed a module import declaration.<br>
   ///<br>
<br>
Modified: cfe/trunk/include/clang/Serialization/ASTBitCodes.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTBitCodes.h?rev=175900&r1=175899&r2=175900&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTBitCodes.h?rev=175900&r1=175899&r2=175900&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/include/clang/Serialization/ASTBitCodes.h (original)<br>
+++ cfe/trunk/include/clang/Serialization/ASTBitCodes.h Fri Feb 22 11:15:32 2013<br>
@@ -1031,7 +1031,9 @@ namespace clang {<br>
       /// function specialization. (Microsoft extension).<br>
       DECL_CLASS_SCOPE_FUNCTION_SPECIALIZATION,<br>
       /// \brief An ImportDecl recording a module import.<br>
-      DECL_IMPORT<br>
+      DECL_IMPORT,<br>
+      /// \brief An EmptyDecl record.<br>
+      DECL_EMPTY<br>
     };<br>
<br>
     /// \brief Record codes for each kind of statement or expression.<br>
<br>
Modified: cfe/trunk/lib/AST/Decl.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=175900&r1=175899&r2=175900&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=175900&r1=175899&r2=175900&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/AST/Decl.cpp (original)<br>
+++ cfe/trunk/lib/AST/Decl.cpp Fri Feb 22 11:15:32 2013<br>
@@ -3343,6 +3343,17 @@ FileScopeAsmDecl *FileScopeAsmDecl::Crea<br>
   return new (Mem) FileScopeAsmDecl(0, 0, SourceLocation(), SourceLocation());<br>
 }<br>
<br>
+void EmptyDecl::anchor() {}<br>
+<br>
+EmptyDecl *EmptyDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L) {<br>
+  return new (C) EmptyDecl(DC, L);<br>
+}<br>
+<br>
+EmptyDecl *EmptyDecl::CreateDeserialized(ASTContext &C, unsigned ID) {<br>
+  void *Mem = AllocateDeserializedDecl(C, ID, sizeof(EmptyDecl));<br>
+  return new (Mem) EmptyDecl(0, SourceLocation());<br>
+}<br>
+<br>
 //===----------------------------------------------------------------------===//<br>
 // ImportDecl Implementation<br>
 //===----------------------------------------------------------------------===//<br>
<br>
Modified: cfe/trunk/lib/AST/DeclBase.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclBase.cpp?rev=175900&r1=175899&r2=175900&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclBase.cpp?rev=175900&r1=175899&r2=175900&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/AST/DeclBase.cpp (original)<br>
+++ cfe/trunk/lib/AST/DeclBase.cpp Fri Feb 22 11:15:32 2013<br>
@@ -558,6 +558,7 @@ unsigned Decl::getIdentifierNamespaceFor<br>
     case ObjCCategory:<br>
     case ObjCCategoryImpl:<br>
     case Import:<br>
+    case Empty:<br>
       // Never looked up by name.<br>
       return 0;<br>
   }<br>
<br>
Modified: cfe/trunk/lib/AST/DeclPrinter.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclPrinter.cpp?rev=175900&r1=175899&r2=175900&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclPrinter.cpp?rev=175900&r1=175899&r2=175900&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/AST/DeclPrinter.cpp (original)<br>
+++ cfe/trunk/lib/AST/DeclPrinter.cpp Fri Feb 22 11:15:32 2013<br>
@@ -51,6 +51,7 @@ namespace {<br>
     void VisitEnumDecl(EnumDecl *D);<br>
     void VisitRecordDecl(RecordDecl *D);<br>
     void VisitEnumConstantDecl(EnumConstantDecl *D);<br>
+    void VisitEmptyDecl(EmptyDecl *D);<br>
     void VisitFunctionDecl(FunctionDecl *D);<br>
     void VisitFriendDecl(FriendDecl *D);<br>
     void VisitFieldDecl(FieldDecl *D);<br>
@@ -723,6 +724,11 @@ void DeclPrinter::VisitNamespaceAliasDec<br>
   Out << *D->getAliasedNamespace();<br>
 }<br>
<br>
+void DeclPrinter::VisitEmptyDecl(EmptyDecl *D) {<br>
+  prettyPrintAttributes(D);<br>
+  Out << ";\n";<br>
+}<br>
+<br>
 void DeclPrinter::VisitCXXRecordDecl(CXXRecordDecl *D) {<br>
   if (!Policy.SuppressSpecifiers && D->isModulePrivate())<br>
     Out << "__module_private__ ";<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGDecl.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=175900&r1=175899&r2=175900&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=175900&r1=175899&r2=175900&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGDecl.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGDecl.cpp Fri Feb 22 11:15:32 2013<br>
@@ -83,6 +83,7 @@ void CodeGenFunction::EmitDecl(const Dec<br>
   case Decl::StaticAssert: // static_assert(X, ""); [C++0x]<br>
   case Decl::Label:        // __label__ x;<br>
   case Decl::Import:<br>
+  case Decl::Empty:<br>
     // None of these decls require codegen support.<br>
     return;<br>
<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=175900&r1=175899&r2=175900&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=175900&r1=175899&r2=175900&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Fri Feb 22 11:15:32 2013<br>
@@ -2742,6 +2742,7 @@ void CodeGenModule::EmitTopLevelDecl(Dec<br>
   case Decl::TypeAliasTemplate:<br>
   case Decl::NamespaceAlias:<br>
   case Decl::Block:<br>
+  case Decl::Empty:<br>
     break;<br>
   case Decl::CXXConstructor:<br>
     // Skip function templates<br>
<br>
Modified: cfe/trunk/lib/Parse/Parser.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=175900&r1=175899&r2=175900&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=175900&r1=175899&r2=175900&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/Parse/Parser.cpp (original)<br>
+++ cfe/trunk/lib/Parse/Parser.cpp Fri Feb 22 11:15:32 2013<br>
@@ -626,15 +626,11 @@ Parser::ParseExternalDeclaration(ParsedA<br>
     return DeclGroupPtrTy();<br>
   case tok::semi:<br>
     // Either a C++11 empty-declaration or attribute-declaration.<br>
-    if (attrs.Range.isValid()) {<br>
-      // FIXME: Add an AST representation for this.<br>
-      Actions.ActOnAttributeDeclaration(attrs.getList());<br>
-      return DeclGroupPtrTy();<br>
-    }<br>
-<br>
+    SingleDecl = Actions.ActOnEmptyDeclaration(getCurScope(),<br>
+                                               attrs.getList(),<br>
+                                               Tok.getLocation());<br>
     ConsumeExtraSemi(OutsideFunction);<br>
-    // TODO: Invoke action for top-level semicolon.<br>
-    return DeclGroupPtrTy();<br>
+    break;<br>
   case tok::r_brace:<br>
     Diag(Tok, diag::err_extraneous_closing_brace);<br>
     ConsumeBrace();<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=175900&r1=175899&r2=175900&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=175900&r1=175899&r2=175900&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Fri Feb 22 11:15:32 2013<br>
@@ -10085,23 +10085,17 @@ Decl *Sema::ActOnFinishLinkageSpecificat<br>
   return LinkageSpec;<br>
 }<br>
<br>
-/// \brief Perform semantic checks on a C++11 attribute-declaration.<br>
-void Sema::ActOnAttributeDeclaration(AttributeList *AttrList) {<br>
-  // FIXME: Build an AST node for an attribute declaration and return it.<br>
-<br>
-  // Since we do not support any attributes which can be used in an attribute<br>
-  // declaration, just diagnose standard and unknown attributes appropriately.<br>
-  for (/**/; AttrList; AttrList = AttrList->getNext()) {<br>
-    if (AttrList->getKind() == AttributeList::IgnoredAttribute ||<br>
-        AttrList->isInvalid())<br>
-      continue;<br>
+Decl *Sema::ActOnEmptyDeclaration(Scope *S,<br>
+                                  AttributeList *AttrList,<br>
+                                  SourceLocation SemiLoc) {<br>
+  Decl *ED = EmptyDecl::Create(Context, CurContext, SemiLoc);<br>
+  // Attribute declarations appertain to empty declaration so we handle<br>
+  // them here.<br>
+  if (AttrList)<br>
+    ProcessDeclAttributeList(S, ED, AttrList);<br>
<br>
-    Diag(AttrList->getLoc(),<br>
-         AttrList->getKind() == AttributeList::UnknownAttribute<br>
-           ? diag::warn_unknown_attribute_ignored<br>
-           : diag::err_attribute_declaration)<br>
-      << AttrList->getName();<br>
-  }<br>
+  CurContext->addDecl(ED);<br>
+  return ED;<br>
 }<br>
<br>
 /// \brief Perform semantic analysis for the variable declaration that<br>
<br>
Modified: cfe/trunk/lib/Serialization/ASTCommon.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTCommon.cpp?rev=175900&r1=175899&r2=175900&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTCommon.cpp?rev=175900&r1=175899&r2=175900&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/Serialization/ASTCommon.cpp (original)<br>
+++ cfe/trunk/lib/Serialization/ASTCommon.cpp Fri Feb 22 11:15:32 2013<br>
@@ -168,6 +168,7 @@ bool serialization::isRedeclarableDeclKi<br>
   case Decl::TypeAliasTemplate:<br>
   case Decl::ObjCProtocol:<br>
   case Decl::ObjCInterface:<br>
+  case Decl::Empty:<br>
     return true;<br>
<br>
   // Never redeclarable.<br>
<br>
Modified: cfe/trunk/lib/Serialization/ASTReaderDecl.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderDecl.cpp?rev=175900&r1=175899&r2=175900&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderDecl.cpp?rev=175900&r1=175899&r2=175900&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/Serialization/ASTReaderDecl.cpp (original)<br>
+++ cfe/trunk/lib/Serialization/ASTReaderDecl.cpp Fri Feb 22 11:15:32 2013<br>
@@ -265,6 +265,7 @@ namespace clang {<br>
     void VisitFriendTemplateDecl(FriendTemplateDecl *D);<br>
     void VisitStaticAssertDecl(StaticAssertDecl *D);<br>
     void VisitBlockDecl(BlockDecl *BD);<br>
+    void VisitEmptyDecl(EmptyDecl *D);<br>
<br>
     std::pair<uint64_t, uint64_t> VisitDeclContext(DeclContext *DC);<br>
<br>
@@ -1526,6 +1527,10 @@ void ASTDeclReader::VisitStaticAssertDec<br>
   D->RParenLoc = ReadSourceLocation(Record, Idx);<br>
 }<br>
<br>
+void ASTDeclReader::VisitEmptyDecl(EmptyDecl *D) {<br>
+  VisitDecl(D);<br>
+}<br>
+<br>
 std::pair<uint64_t, uint64_t><br>
 ASTDeclReader::VisitDeclContext(DeclContext *DC) {<br>
   uint64_t LexicalOffset = Record[Idx++];<br>
@@ -2129,6 +2134,9 @@ Decl *ASTReader::ReadDeclRecord(DeclID I<br>
     // locations.<br>
     D = ImportDecl::CreateDeserialized(Context, ID, Record.back());<br>
     break;<br>
+  case DECL_EMPTY:<br>
+    D = EmptyDecl::CreateDeserialized(Context, ID);<br>
+    break;<br>
   }<br>
<br>
   assert(D && "Unknown declaration reading AST file");<br>
<br>
Modified: cfe/trunk/lib/Serialization/ASTWriterDecl.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterDecl.cpp?rev=175900&r1=175899&r2=175900&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterDecl.cpp?rev=175900&r1=175899&r2=175900&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/Serialization/ASTWriterDecl.cpp (original)<br>
+++ cfe/trunk/lib/Serialization/ASTWriterDecl.cpp Fri Feb 22 11:15:32 2013<br>
@@ -102,6 +102,7 @@ namespace clang {<br>
     void VisitFriendTemplateDecl(FriendTemplateDecl *D);<br>
     void VisitStaticAssertDecl(StaticAssertDecl *D);<br>
     void VisitBlockDecl(BlockDecl *D);<br>
+    void VisitEmptyDecl(EmptyDecl *D);<br>
<br>
     void VisitDeclContext(DeclContext *DC, uint64_t LexicalOffset,<br>
                           uint64_t VisibleOffset);<br>
@@ -780,6 +781,11 @@ void ASTDeclWriter::VisitFileScopeAsmDec<br>
   Code = serialization::DECL_FILE_SCOPE_ASM;<br>
 }<br>
<br>
+void ASTDeclWriter::VisitEmptyDecl(EmptyDecl *D) {<br>
+  VisitDecl(D);<br>
+  Code = serialization::DECL_EMPTY;<br>
+}<br>
+<br>
 void ASTDeclWriter::VisitBlockDecl(BlockDecl *D) {<br>
   VisitDecl(D);<br>
   Writer.AddStmt(D->getBody());<br>
<br>
Modified: cfe/trunk/test/Parser/cxx0x-attributes.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/cxx0x-attributes.cpp?rev=175900&r1=175899&r2=175900&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/cxx0x-attributes.cpp?rev=175900&r1=175899&r2=175900&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/test/Parser/cxx0x-attributes.cpp (original)<br>
+++ cfe/trunk/test/Parser/cxx0x-attributes.cpp Fri Feb 22 11:15:32 2013<br>
@@ -279,4 +279,5 @@ int v4[2][[gnu::unused]]; // expected-wa<br>
 int v5()[[gnu::unused]]; // expected-warning {{attribute 'unused' ignored}}<br>
<br>
 [[attribute_declaration]]; // expected-warning {{unknown attribute 'attribute_declaration' ignored}}<br>
-[[noreturn]]; // expected-error {{'noreturn' attribute cannot be used in an attribute declaration}}<br>
+[[noreturn]]; // expected-error {{'noreturn' attribute only applies to functions and methods}}<br>
+[[carries_dependency]]; // expected-error {{'carries_dependency' attribute only applies to functions, methods, and parameters}}<br>
<br>
Modified: cfe/trunk/test/SemaCXX/cxx11-ast-print.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/cxx11-ast-print.cpp?rev=175900&r1=175899&r2=175900&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/cxx11-ast-print.cpp?rev=175900&r1=175899&r2=175900&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/test/SemaCXX/cxx11-ast-print.cpp (original)<br>
+++ cfe/trunk/test/SemaCXX/cxx11-ast-print.cpp Fri Feb 22 11:15:32 2013<br>
@@ -38,3 +38,5 @@ const char *p8 = 4.9_quux;<br>
 const char *p9 = 0x42e3F_fritz;<br>
 // CHECK: const char *p10 = 3.300e+15_fritz;<br>
 const char *p10 = 3.300e+15_fritz;<br>
+// CHECK: ;<br>
+;<br>
<br>
Modified: cfe/trunk/tools/libclang/RecursiveASTVisitor.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/RecursiveASTVisitor.h?rev=175900&r1=175899&r2=175900&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/RecursiveASTVisitor.h?rev=175900&r1=175899&r2=175900&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/tools/libclang/RecursiveASTVisitor.h (original)<br>
+++ cfe/trunk/tools/libclang/RecursiveASTVisitor.h Fri Feb 22 11:15:32 2013<br>
@@ -1199,6 +1199,8 @@ DEF_TRAVERSE_DECL(BlockDecl, {<br>
     return true;<br>
   })<br>
<br>
+DEF_TRAVERSE_DECL(EmptyDecl, { })<br>
+<br>
 DEF_TRAVERSE_DECL(FileScopeAsmDecl, {<br>
     TRY_TO(TraverseStmt(D->getAsmString()));<br>
   })<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div>