Assignment operators should return by reference.
authorJohn McCall <rjmccall@apple.com>
Mon, 4 Apr 2016 18:53:01 +0000 (18:53 +0000)
committerJohn McCall <rjmccall@apple.com>
Mon, 4 Apr 2016 18:53:01 +0000 (18:53 +0000)
Thanks to Sean Silva for pointing this out.

llvm-svn: 265328

clang/include/clang/AST/CharUnits.h

index b2da51c..564c8ec 100644 (file)
@@ -149,7 +149,7 @@ namespace clang {
       CharUnits operator/ (QuantityType N) const {
         return CharUnits(Quantity / N);
       }
-      CharUnits operator/= (QuantityType N) {
+      CharUnits &operator/= (QuantityType N) {
         Quantity /= N;
         return *this;
       }