mirror of
https://github.com/google/styleguide.git
synced 2024-03-22 13:11:43 +08:00
Add array and atomic to IWYU in cpplint
This commit is contained in:
parent
e25d7f648c
commit
ca8fa95ae6
2
cpplint/cpplint.py
vendored
2
cpplint/cpplint.py
vendored
|
@ -5344,6 +5344,8 @@ def ExpectingFunctionArgs(clean_lines, linenum):
|
||||||
|
|
||||||
|
|
||||||
_HEADERS_CONTAINING_TEMPLATES = (
|
_HEADERS_CONTAINING_TEMPLATES = (
|
||||||
|
('<array>', ('array',)),
|
||||||
|
('<atomic>', ('atomic',)),
|
||||||
('<deque>', ('deque',)),
|
('<deque>', ('deque',)),
|
||||||
('<functional>', ('unary_function', 'binary_function',
|
('<functional>', ('unary_function', 'binary_function',
|
||||||
'plus', 'minus', 'multiplies', 'divides', 'modulus',
|
'plus', 'minus', 'multiplies', 'divides', 'modulus',
|
||||||
|
|
|
@ -1076,6 +1076,28 @@ class CpplintTest(CpplintTestBase):
|
||||||
""",
|
""",
|
||||||
'Add #include <utility> for swap'
|
'Add #include <utility> for swap'
|
||||||
' [build/include_what_you_use] [4]')
|
' [build/include_what_you_use] [4]')
|
||||||
|
self.TestIncludeWhatYouUse(
|
||||||
|
"""#include <array>
|
||||||
|
std::array<int, 10> A;
|
||||||
|
""",
|
||||||
|
'')
|
||||||
|
self.TestIncludeWhatYouUse(
|
||||||
|
"""#include <string>
|
||||||
|
std::array<int, 10> A;
|
||||||
|
""",
|
||||||
|
'Add #include <array> for array<>'
|
||||||
|
' [build/include_what_you_use] [4]')
|
||||||
|
self.TestIncludeWhatYouUse(
|
||||||
|
"""#include <atomic>
|
||||||
|
std::atomic<int> A;
|
||||||
|
""",
|
||||||
|
'')
|
||||||
|
self.TestIncludeWhatYouUse(
|
||||||
|
"""#include <string>
|
||||||
|
std::atomic<int> A;
|
||||||
|
""",
|
||||||
|
'Add #include <atomic> for atomic<>'
|
||||||
|
' [build/include_what_you_use] [4]')
|
||||||
|
|
||||||
# Test the UpdateIncludeState code path.
|
# Test the UpdateIncludeState code path.
|
||||||
mock_header_contents = ['#include "blah/foo.h"', '#include "blah/bar.h"']
|
mock_header_contents = ['#include "blah/foo.h"', '#include "blah/bar.h"']
|
||||||
|
|
Loading…
Reference in New Issue
Block a user