]> granicus.if.org Git - clang/blobdiff - Sema/SemaDecl.cpp
Add support for attribute(deprecated), patch by Nuno Lopes!
[clang] / Sema / SemaDecl.cpp
index df6dd5c2e18ffb0ab16bdb840f715cc970ead1c4..26528485db1cca7ecc32b5fb3c1fa587cad77804 100644 (file)
@@ -255,6 +255,8 @@ FunctionDecl *Sema::MergeFunctionDecl(FunctionDecl *New, ScopedDecl *OldD) {
     Diag(OldD->getLocation(), diag::err_previous_definition);
     return New;
   }
+
+  // FIXME: propagate old Attrs to the New decl
   
   QualType OldQType = Old->getCanonicalType();
   QualType NewQType = New->getCanonicalType();
@@ -1778,6 +1780,9 @@ void Sema::HandleDeclAttribute(Decl *New, AttributeList *Attr) {
       vDecl->setType(newType);
     }
     break;
+  case AttributeList::AT_deprecated:
+    New->addAttr(new DeprecatedAttr());
+    break;
   case AttributeList::AT_aligned:
     HandleAlignedAttribute(New, Attr);
     break;
@@ -1791,7 +1796,11 @@ void Sema::HandleDeclAttribute(Decl *New, AttributeList *Attr) {
     HandleNoReturnAttribute(New, Attr);
     break;
   default:
-    // FIXME: add other attributes...
+#if 0
+    // TODO: when we have the full set of attributes, warn about unknown ones.
+    Diag(Attr->getLoc(), diag::warn_attribute_ignored,
+         Attr->getName()->getName());
+#endif
     break;
   }
 }