-Wredundant-tags doesn't consider type declarations that are also the first uses of the type, such as in 'void f (struct S);' and issues false positives for those. According to the reported that's making it harder to use the warning to clean up LibreOffice. The attached patch extends -Wredundant-tags to avoid these false positives by relying on the same class_decl_loc_t::class2loc mapping as -Wmismatched-tags. The patch also somewhat improves the detection of both issues in template declarations (though more work is still needed there). Tested on x86_64-linux. Martin