summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2013-07-07 23:49:50 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2013-07-07 23:49:50 +0000
commitbcd0650c1e50a2e73b11717731e074a1ac2ac5ba (patch)
treeac98c6c8e1a15663215004a0e2127a6a840c7d71 /lib/CodeGen/CGExpr.cpp
parentbd9cbd22b832ce65a085801259cf2d3df77830e4 (diff)
downloadclang-bcd0650c1e50a2e73b11717731e074a1ac2ac5ba.tar.gz
clang-bcd0650c1e50a2e73b11717731e074a1ac2ac5ba.tar.bz2
clang-bcd0650c1e50a2e73b11717731e074a1ac2ac5ba.tar.xz
Sema: Do not merge new decls with invalid, old decls
Sema::MergeFunctionDecl attempts merging two decls even if the old decl is invalid. This can lead to interesting circumstances where we successfully merge the decls but the result makes no sense. Take the following for example: template <typename T> int main(void); int main(void); Sema will not consider these to be overloads of the same name because main can't be overloaded, which means that this must be a redeclaration. In this case the templated decl is compatible with the non-templated decl allowing the Sema::CheckFunctionDeclaration machinery to move on and do bizarre things like setting the previous decl of a non-templated decl to a templated decl! The way I see it, we should just bail from MergeFunctionDecl if the old decl is invalid. This fixes PR16531. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185779 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
0 files changed, 0 insertions, 0 deletions