Index: SemaDecl.cpp =================================================================== --- SemaDecl.cpp +++ SemaDecl.cpp @@ -2033,6 +2033,12 @@ if (getLangOpts().Modules || getLangOpts().C11) return; + // Added isImplicit() check, because implicit TypeDecl::getLocation() + // returns 0. The're many implicit typedefs in OpenCL, e.g. atomic_flag. + if (Old->isImplicit() || New->isImplicit()) { + return; + } + // If we have a redefinition of a typedef in C, emit a warning. This warning // is normally mapped to an error, but can be controlled with // -Wtypedef-redefinition. If either the original or the redefinition is