Skip to content

[clang-tidy] false positive for modernize-type-traits with structured bindings #153649

@matthew-f

Description

@matthew-f

Hi

Using an llvm update from a few days modernize-type-traits is generating what looks like a false positive. An update from today still exhibits the same problem

std::map<int, int> map = {{1, 2}, {3, 4}};

for (const auto& [a, b] : map)
	{
		std::cout << a << b;
	}

generates

main.cpp:36:20: error: use c++14 style type templates [modernize-type-traits,-warnings-as-errors]
   36 |         for (const auto& [a, b] : map)
      |                           ^
      |                           _t
main.cpp:36:23: error: use c++14 style type templates [modernize-type-traits,-warnings-as-errors]
   36 |         for (const auto& [a, b] : map)
      |                              ^
      |                              _t


Metadata

Metadata

Assignees

Labels

clang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second party

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions