Index: lib/AST/ASTContext.cpp =================================================================== --- lib/AST/ASTContext.cpp +++ lib/AST/ASTContext.cpp @@ -1501,7 +1501,9 @@ Align = std::min(Align, FieldAlign); } - } + } else if (isa(VD)) + // GCC extension: alignment of functions is 32 bits + Align = 32; } return toCharUnitsFromBits(Align); Index: test/Sema/warn-cast-align.c =================================================================== --- test/Sema/warn-cast-align.c +++ test/Sema/warn-cast-align.c @@ -59,3 +59,11 @@ i = (int *)&s.s0; i = (int *)a; } + +// No warnings. +typedef int (*FnTy)(void); +unsigned int func5(void); + +FnTy test5(void) { + return (FnTy)&func5; +}