Bug 1499212 Document static storage requirement for same-char_type AssignLiteral overload r=dbaron
authorKarl Tomlinson <karlt+@karlt.net>
Tue, 16 Oct 2018 21:09:27 +0000
changeset 500520 386c46fc6e8dce5760f74427c125a63261c4b908
parent 500519 5463ea36a953009a99dded33078b79f7c45b38aa
child 500521 9469c37cc124badf9e8cfd29be4469f50a9c2c47
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1499212
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1499212 Document static storage requirement for same-char_type AssignLiteral overload r=dbaron Depends on D8770 Differential Revision: https://phabricator.services.mozilla.com/D8771
xpcom/string/nsTSubstring.h
--- a/xpcom/string/nsTSubstring.h
+++ b/xpcom/string/nsTSubstring.h
@@ -470,18 +470,19 @@ public:
   {
     return AssignASCII(aData,
                        mozilla::AssertedCast<size_type, size_t>(strlen(aData)),
                        aFallible);
   }
 
   // AssignLiteral must ONLY be applied to an actual literal string, or
   // a character array *constant* declared without an explicit size.
-  // Do not attempt to use it with a non-constant character array variable.
-  // Use AssignASCII for that.
+  // Do not attempt to use it with a character array variable that is not
+  // constant or does not have static storage duration. Use AssignASCII for
+  // those.
   //
   // This method does not need a fallible version, because it uses the
   // POD buffer of the literal as the string's buffer without allocating.
   // The literal does not need to be ASCII. If this a 16-bit string, this
   // method takes a u"" literal. (The overload on 16-bit strings that takes
   // a "" literal takes only ASCII.)
   template<int N>
   void AssignLiteral(const char_type (&aStr)[N])