Merge "Recognize new clang and clang-tidy warnings."
diff --git a/core/clang/tidy.mk b/core/clang/tidy.mk
index 019e6f0..35871f0 100644
--- a/core/clang/tidy.mk
+++ b/core/clang/tidy.mk
@@ -16,9 +16,9 @@
 
 # Most Android source files are not clang-tidy clean yet.
 # Global tidy checks include only google* and misc-macro-parentheses,
-# but not google-readability*.
+# but not google-readability* or google-runtime-references.
 DEFAULT_GLOBAL_TIDY_CHECKS := \
-  -*,google*,-google-readability*,misc-macro-parentheses
+  -*,google*,-google-readability*,-google-runtime-references,misc-macro-parentheses
 
 # Disable style rules usually not followed by external projects.
 # Every word in DEFAULT_LOCAL_TIDY_CHECKS list has the following format:
@@ -37,9 +37,9 @@
   external/webrtc/:,google-runtime-int \
   hardware/qcom:,-google-build-using-namespace \
   hardware/qcom:,-google-explicit-constructor,-google-runtime-int \
-  vendor/lge:,-google-build-using-namespace \
+  vendor/lge:,-google-build-using-namespace,-misc-macro-parentheses \
   vendor/lge:,-google-explicit-constructor,-google-runtime-int \
-  vendor/widevine:,-google-build-using-namespace \
+  vendor/widevine:,-google-build-using-namespace,-misc-macro-parentheses \
   vendor/widevine:,-google-explicit-constructor,-google-runtime-int \
 
 # Returns 2nd word of $(1) if $(2) has prefix of the 1st word of $(1).
diff --git a/tools/warn.py b/tools/warn.py
index c944fb6..8f7a638 100755
--- a/tools/warn.py
+++ b/tools/warn.py
@@ -119,7 +119,7 @@
         'patterns':[r".*: warning: incompatible implicit declaration of built-in function .+"] },
     { 'category':'C/C++',   'severity':severity.HIGH,     'members':[], 'option':'',
         'description':'Null passed as non-null argument',
-        'patterns':[r".*: warning: Null passed to a callee that requires a non-null argument"] },
+        'patterns':[r".*: warning: Null passed to a callee that requires a non-null"] },
     { 'category':'C/C++',   'severity':severity.MEDIUM,   'members':[], 'option':'-Wunused-parameter',
         'description':'Unused parameter',
         'patterns':[r".*: warning: unused parameter '.*'"] },
@@ -1366,6 +1366,9 @@
     { 'category':'C/C++',   'severity':severity.MEDIUM,   'members':[], 'option':'',
         'description':'Possible broken line continuation',
         'patterns':[r".*: warning: backslash and newline separated by space"] },
+    { 'category':'C/C++',   'severity':severity.MEDIUM,   'members':[], 'option':'-Wundefined-var-template',
+        'description':'Undefined variable template',
+        'patterns':[r".*: warning: instantiation of variable .* no definition is available"] },
     { 'category':'C/C++',   'severity':severity.MEDIUM,   'members':[], 'option':'-Wundefined-inline',
         'description':'Inline function is not defined',
         'patterns':[r".*: warning: inline function '.*' is not defined"] },
@@ -1504,9 +1507,9 @@
     { 'category':'C/C++',   'severity':severity.MEDIUM,   'members':[], 'option':'-Wnon-literal-null-conversion',
         'description':'Zero used as null pointer',
         'patterns':[r".*: warning: expression .* zero treated as a null pointer constant"] },
-    { 'category':'C/C++',   'severity':severity.MEDIUM,   'members':[], 'option':'-Wliteral-conversion',
+    { 'category':'C/C++',   'severity':severity.MEDIUM,   'members':[], 'option':'',
         'description':'Implicit conversion changes value',
-        'patterns':[r".*: warning: implicit conversion .* changes value from .* to .*literal-conversion"] },
+        'patterns':[r".*: warning: implicit conversion .* changes value from .* to .*-conversion"] },
     { 'category':'C/C++',   'severity':severity.MEDIUM,   'members':[], 'option':'',
         'description':'Passing NULL as non-pointer argument',
         'patterns':[r".*: warning: passing NULL to non-pointer argument [0-9]+ of '.+'"] },
@@ -1734,8 +1737,17 @@
         'description':'clang-tidy c++ core guidelines',
         'patterns':[r".*: .+\[cppcoreguidelines-.+\]$"] },
     { 'category':'C/C++',   'severity':severity.TIDY,     'members':[], 'option':'',
-        'description':'clang-tidy google-runtime',
-        'patterns':[r".*: .+\[google-runtime-.+\]$"] },
+        'description':'clang-tidy google-default-arguments',
+        'patterns':[r".*: .+\[google-default-arguments\]$"] },
+    { 'category':'C/C++',   'severity':severity.TIDY,     'members':[], 'option':'',
+        'description':'clang-tidy google-runtime-int',
+        'patterns':[r".*: .+\[google-runtime-int\]$"] },
+    { 'category':'C/C++',   'severity':severity.TIDY,     'members':[], 'option':'',
+        'description':'clang-tidy google-runtime-operator',
+        'patterns':[r".*: .+\[google-runtime-operator\]$"] },
+    { 'category':'C/C++',   'severity':severity.TIDY,     'members':[], 'option':'',
+        'description':'clang-tidy google-runtime-references',
+        'patterns':[r".*: .+\[google-runtime-references\]$"] },
     { 'category':'C/C++',   'severity':severity.TIDY,     'members':[], 'option':'',
         'description':'clang-tidy google-build',
         'patterns':[r".*: .+\[google-build-.+\]$"] },
@@ -1749,6 +1761,9 @@
         'description':'clang-tidy google-global',
         'patterns':[r".*: .+\[google-global-.+\]$"] },
     { 'category':'C/C++',   'severity':severity.TIDY,     'members':[], 'option':'',
+        'description':'clang-tidy google- other',
+        'patterns':[r".*: .+\[google-.+\]$"] },
+    { 'category':'C/C++',   'severity':severity.TIDY,     'members':[], 'option':'',
         'description':'clang-tidy modernize',
         'patterns':[r".*: .+\[modernize-.+\]$"] },
     { 'category':'C/C++',   'severity':severity.TIDY,     'members':[], 'option':'',