Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1154)

Unified Diff: base/compiler_specific.h

Issue 7094005: Add FINAL to base/compiler_specific. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/compiler_specific.h
diff --git a/base/compiler_specific.h b/base/compiler_specific.h
index 0a6e05a6c67988b64b416b612d47ec41c457a78f..c61641219455c72db67c605feb9e8c2638727ea8 100644
--- a/base/compiler_specific.h
+++ b/base/compiler_specific.h
@@ -137,4 +137,15 @@
// If available, it would look like:
// __attribute__((format(wprintf, format_param, dots_param)))
+// Annotate a class to indicate that it cannot be subclassed. Use this very
+// sparingly. The only valid use case is if you have a class with virtual
+// methods but no virtual destructor -- see http://crbug.com/84424
+// Use like:
+// class B FINAL : public A {};
+#if defined(__clang__)
Mark Mentovai 2011/05/31 14:41:05 Should we have COMPILER_CLANG?
+#define FINAL final
Mark Mentovai 2011/05/31 14:41:05 I’m surprised it’s final and not __final__ or an _
+#else
+#define FINAL
+#endif
+
#endif // BASE_COMPILER_SPECIFIC_H_
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698