r342735 - [AST][NFC] DeclarationName.h : add missing parentheses to silence warnings

Bruno Ricci via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 21 07:03:32 PDT 2018


Author: brunoricci
Date: Fri Sep 21 07:03:32 2018
New Revision: 342735

URL: http://llvm.org/viewvc/llvm-project?rev=342735&view=rev
Log:
[AST][NFC] DeclarationName.h : add missing parentheses to silence warnings

Some bots are complaining about missing parentheses in assertions added in
r342729: [AST] Various optimizations + refactoring in DeclarationName(Table)


Modified:
    cfe/trunk/include/clang/AST/DeclarationName.h

Modified: cfe/trunk/include/clang/AST/DeclarationName.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclarationName.h?rev=342735&r1=342734&r2=342735&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclarationName.h (original)
+++ cfe/trunk/include/clang/AST/DeclarationName.h Fri Sep 21 07:03:32 2018
@@ -277,9 +277,9 @@ private:
   /// Construct a declaration name from a CXXSpecialNameExtra.
   DeclarationName(detail::CXXSpecialNameExtra *Name,
                   StoredNameKind StoredKind) {
-    assert(StoredKind == StoredCXXConstructorName ||
+    assert((StoredKind == StoredCXXConstructorName ||
            StoredKind == StoredCXXDestructorName ||
-           StoredKind == StoredCXXConversionFunctionName &&
+           StoredKind == StoredCXXConversionFunctionName) &&
                "Invalid StoredNameKind when constructing a DeclarationName"
                " from a CXXSpecialNameExtra!");
     setPtrAndKind(Name, StoredKind);
@@ -308,9 +308,9 @@ private:
   /// Assert that the stored pointer points to a CXXSpecialNameExtra
   /// and return it.
   detail::CXXSpecialNameExtra *castAsCXXSpecialNameExtra() const {
-    assert(getStoredNameKind() == StoredCXXConstructorName ||
+    assert((getStoredNameKind() == StoredCXXConstructorName ||
            getStoredNameKind() == StoredCXXDestructorName ||
-           getStoredNameKind() == StoredCXXConversionFunctionName &&
+           getStoredNameKind() == StoredCXXConversionFunctionName) &&
                "DeclarationName does not store a CXXSpecialNameExtra!");
     return static_cast<detail::CXXSpecialNameExtra *>(getPtr());
   }
@@ -318,7 +318,7 @@ private:
   /// Assert that the stored pointer points to a CXXOperatorIdName
   /// and return it.
   detail::CXXOperatorIdName *castAsCXXOperatorIdName() const {
-    assert(getStoredNameKind() == StoredCXXOperatorName &&
+    assert((getStoredNameKind() == StoredCXXOperatorName) &&
            "DeclarationName does not store a CXXOperatorIdName!");
     return static_cast<detail::CXXOperatorIdName *>(getPtr());
   }




More information about the cfe-commits mailing list