]> granicus.if.org Git - clang/commit
Make ASTContext::getDeclAlign return the correct alignment for
authorAkira Hatanaka <ahatanaka@apple.com>
Fri, 6 Jan 2017 17:56:15 +0000 (17:56 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Fri, 6 Jan 2017 17:56:15 +0000 (17:56 +0000)
commit6ad43775258405f22d7db3fe6d76f33621b8ba83
tree79f2f81a36e50657da59a988ee23795d7220cb27
parent95fe8f8c7da9f8b233457c976aec93c5664272cd
Make ASTContext::getDeclAlign return the correct alignment for
FunctionDecls.

This commit silences an incorrect warning that is issued when a function
pointer is cast to another function pointer type. The warning gets
issued because alignments of the source and destination do not match in
Sema::CheckCastAlign, which happens because ASTContext::getTypeInfoImpl
and ASTContext::getDeclAlign return different values for functions (the
former returns 4 while the latter returns 1).

This should fix PR31558.

rdar://problem/29533528

Differential Revision: https://reviews.llvm.org/D27478

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291253 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AST/ASTContext.cpp
test/Sema/warn-cast-align.c