Fix treatment of types defined in function prototype
authorSerge Pavlov <sepavloff@gmail.com>
Wed, 25 Jun 2014 17:09:41 +0000 (17:09 +0000)
committerSerge Pavlov <sepavloff@gmail.com>
Wed, 25 Jun 2014 17:09:41 +0000 (17:09 +0000)
commita826147eef05d1d4fa0f3efdd1eeb4c71ae13b9d
tree4d955aea3d73adfaaa7fe5b3097fc1b8f603293f
parent9029bda8a31c6d2f908fd1d6e6e4d8615c8c76c7
Fix treatment of types defined in function prototype

Types defined in function prototype are diagnosed earlier in C++ compilation.
They are put into declaration context where the prototype is introduced. Later on,
when FunctionDecl object is created, these types are moved into the function context.

This patch fixes PR19018 and PR18963.

Differential Revision: http://reviews.llvm.org/D4145

llvm-svn: 211718
clang/lib/AST/Decl.cpp
clang/lib/Sema/SemaDecl.cpp
clang/test/Sema/decl-in-prototype.c
clang/test/SemaCXX/type-definition-in-specifier.cpp