Index: clang-tidy/utils/TypeTraits.cpp =================================================================== --- clang-tidy/utils/TypeTraits.cpp +++ clang-tidy/utils/TypeTraits.cpp @@ -62,8 +62,10 @@ if (ClassDecl->hasTrivialDefaultConstructor()) return true; - // If all its fields are trivially constructible. + // If all its fields are trivially constructible and have no default initializers. for (const FieldDecl *Field : ClassDecl->fields()) { + if (Field->hasInClassInitializer()) + return false; if (!isTriviallyDefaultConstructible(Field->getType(), Context)) return false; } Index: test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp =================================================================== --- test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp +++ test/clang-tidy/cppcoreguidelines-pro-type-member-init.cpp @@ -367,3 +367,14 @@ PositiveIndirectMember() {} // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: constructor does not initialize these fields: A }; + + +struct Bug30487 +{ + int a = 0; +}; + +void Bug30487_f() +{ + Bug30487 s; +}