llvm-project/clang/test
David Majnemer ea5092a3b0 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.

llvm-svn: 185779
2013-07-07 23:49:50 +00:00
..
ARCMT Add 'not' to commands that are expected to fail. 2013-07-04 16:16:58 +00:00
ASTMerge Add 'not' to commands that are expected to fail. 2013-07-04 16:16:58 +00:00
Analysis Add a test case for r185707/PR16547. 2013-07-05 15:51:00 +00:00
CXX Sema: Do not merge new decls with invalid, old decls 2013-07-07 23:49:50 +00:00
CodeCompletion PR14381: Never skip constexpr function bodies when code-completing. We may need 2012-11-19 21:13:18 +00:00
CodeGen Update test for change in r185735. 2013-07-06 00:30:27 +00:00
CodeGenCUDA Use kernel metadata to differentiate between kernel and device 2013-03-30 14:38:24 +00:00
CodeGenCXX Fix regression from r185450. 2013-07-05 18:41:30 +00:00
CodeGenObjC Replace 'grep foo | count 0' with 'not grep foo'. 2013-07-04 15:22:16 +00:00
CodeGenObjCXX More fixes for block mangling. 2013-07-02 17:52:28 +00:00
CodeGenOpenCL Use kernel metadata to differentiate between kernel and device 2013-03-30 14:38:24 +00:00
Coverage Objective-C: When using super.prop, property should be 2013-03-11 22:26:33 +00:00
Driver Require a shell for this test. 2013-07-04 16:23:44 +00:00
FixIt Add 'not' to commands that are expected to fail. 2013-07-04 16:16:58 +00:00
Format Add 'not' to commands that are expected to fail. 2013-07-04 16:16:58 +00:00
Frontend Add 'not' to commands that are expected to fail. 2013-07-04 16:16:58 +00:00
Headers Enable -ffreestanding for this test, to avoid #include_next'ing the system's 2013-07-03 18:35:53 +00:00
Index [libclang] Introduce clang_Cursor_isObjCOptional, which returns whether the declaration was affected by "@optional" 2013-07-05 20:44:37 +00:00
Lexer Add 'not' to commands that are expected to fail. 2013-07-04 16:16:58 +00:00
Misc Use llvm::sys::fs::createUniqueFile. 2013-07-05 21:13:58 +00:00
Modules Add 'not' to commands that are expected to fail. 2013-07-04 16:16:58 +00:00
OpenMP OpenMP threadprivate with qualified names. 2013-05-13 04:18:18 +00:00
PCH Use the new --crash option in commands that are expected to crash. 2013-07-05 02:53:30 +00:00
Parser Sema: Do not merge new decls with invalid, old decls 2013-07-07 23:49:50 +00:00
Preprocessor Add 'not' to commands that are expected to fail. 2013-07-04 16:16:58 +00:00
Rewriter Add 'not' to commands that are expected to fail. 2013-07-04 16:16:58 +00:00
Sema Sema: Do not merge new decls with invalid, old decls 2013-07-07 23:49:50 +00:00
SemaCUDA
SemaCXX Add 'not' to commands that are expected to fail. 2013-07-04 16:16:58 +00:00
SemaObjC Objective-C: Warn when fast enumeration variable isn't used. 2013-07-06 18:04:13 +00:00
SemaObjCXX Remove referece type onproperty of abstract 2013-07-05 23:50:55 +00:00
SemaOpenCL Add an error to check that all program scope variables are in the constant address space in OpenCL. 2013-04-05 20:14:50 +00:00
SemaTemplate Sema: Do not merge new decls with invalid, old decls 2013-07-07 23:49:50 +00:00
TableGen Revert "tg-fixits.td: fixup for Linux" 2013-01-11 02:37:47 +00:00
Tooling Add 'not' to commands that are expected to fail. 2013-07-04 16:16:58 +00:00
Unit Propagate path to ASan/MSan symbolizer into test environment to produce useful reports on errors. 2013-04-04 07:41:20 +00:00
CMakeLists.txt Re-add clang-format tests to clang/test. 2013-03-25 09:14:25 +00:00
Makefile
TestRunner.sh
cxx-sections.data
lit.cfg clang/test/lit.cfg: Improve is_filesystem_case_insensitive() to work properly on cygwin. 2013-07-01 09:51:55 +00:00
lit.site.cfg.in Add asan/msan to the list of available features in LIT test runner. Mark ASan-unfriendly test as XFAIL. 2013-03-26 08:28:18 +00:00
make_test_dirs.pl