Index: cfe/trunk/lib/Sema/SemaDecl.cpp =================================================================== --- cfe/trunk/lib/Sema/SemaDecl.cpp +++ cfe/trunk/lib/Sema/SemaDecl.cpp @@ -2154,7 +2154,9 @@ // -Wtypedef-redefinition. If either the original or the redefinition is // in a system header, don't emit this for compatibility with GCC. if (getDiagnostics().getSuppressSystemWarnings() && - (Context.getSourceManager().isInSystemHeader(Old->getLocation()) || + // Some standard types are defined implicitly in Clang (e.g. OpenCL). + (Old->isImplicit() || + Context.getSourceManager().isInSystemHeader(Old->getLocation()) || Context.getSourceManager().isInSystemHeader(New->getLocation()))) return; Index: cfe/trunk/test/SemaOpenCL/types.cl =================================================================== --- cfe/trunk/test/SemaOpenCL/types.cl +++ cfe/trunk/test/SemaOpenCL/types.cl @@ -0,0 +1,6 @@ +// RUN: %clang_cc1 %s -cl-std=CL2.0 -verify -fsyntax-only + +// expected-no-diagnostics + +// Check redefinition of standard types +typedef atomic_int atomic_flag;