Suppress Clang 7 self-assignment warnings
authorMika Väinölä <mika.vainola@siru.fi>
Wed, 3 Oct 2018 13:03:46 +0000 (16:03 +0300)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 5 Oct 2018 12:50:14 +0000 (08:50 -0400)
Clang 7 warns on two intentional self-assignments. According to the
release notes "the warning can be suppressed by adding *& to the
right-hand side or casting it to the appropriate reference type."

Component: Framework

VK-GL-CTS issue: 1401

Change-Id: I3145b1965d46f617eb10ff8a60d038ce9bbb5cbf

framework/delibs/decpp/deSharedPtr.cpp

index c2c90b44f144dac6a4cd42fb7eb7d6d06154a585..f87fec1b86605c5f32bd90f3c9450f93e69941b3 100644 (file)
@@ -179,7 +179,7 @@ void SharedPtr_selfTest (void)
                SharedPtr<Object> ptrA;
                SharedPtr<Object> ptrB;
                ptrB = ptrA;
-               ptrB = ptrB;
+               ptrB = *&ptrB;
        }
 
        // Basic test.
@@ -235,7 +235,7 @@ void SharedPtr_selfTest (void)
                        SharedPtr<Object> ptr(new Object(exists));
                        DE_TEST_ASSERT(exists);
                        DE_TEST_ASSERT(ptr.get() != DE_NULL);
-                       ptr = ptr;
+                       ptr = *&ptr;
                }
                DE_TEST_ASSERT(!exists);
        }