summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/extern-c.cpp
Commit message (Collapse)AuthorAgeFilesLines
* PR35697: look at the first declaration when determining whether a function orRichard Smith2018-01-031-0/+17
| | | | | | variable is extern "C" in linkage calculations. llvm-svn: 321686
* Fix filtering of prior declarations when checking for a tag redeclaration toRichard Smith2016-05-231-0/+38
| | | | | | | map to the redecl context for both decls, not just one of them, and to properly check that the decl contexts are equivalent. llvm-svn: 270482
* [Sema] Emit a better diagnostic when variable redeclarations disagreeDavid Majnemer2015-07-141-1/+1
| | | | | | | | | | | We referred to all declaration in definitions in our diagnostic messages which is can be inaccurate. Instead, classify the declaration and emit an appropriate diagnostic for the new declaration and an appropriate note pointing to the old one. This fixes PR24116. llvm-svn: 242190
* Added warning on structures/unions that are empty or contain onlySerge Pavlov2013-11-141-1/+18
| | | | | | | | | | bit fields of zero size. Warnings are generated in C++ mode and if only such type is defined inside extern "C" block. The patch fixed PR5065. Differential Revision: http://llvm-reviews.chandlerc.com/D2151 llvm-svn: 194653
* Switch the semantic DeclContext for a block-scope declaration of a function orRichard Smith2013-09-201-5/+25
| | | | | | | | | | | | | | variable from being the function to being the enclosing namespace scope (in C++) or the TU (in C). This allows us to fix a selection of related issues where we would build incorrect redeclaration chains for such declarations, and fail to notice type mismatches. Such declarations are put into a new IdentifierNamespace, IDNS_LocalExtern, which is only found when searching scopes, and not found when searching DeclContexts. Such a declaration is only made visible in its DeclContext if there are no non-LocalExtern declarations. llvm-svn: 191064
* Reinstate r185229, reverted in r185256, with a tweak: further ignore theRichard Smith2013-06-301-14/+75
| | | | | | | | | | | | | | | | | | | | | | | standard's rule that an extern "C" declaration conflicts with any entity in the global scope with the same name. Now we only care if the global scope entity is a variable declaration (and so might have the same mangled name as the extern "C" declaration). This has been reported as a standard defect. Original commit message: PR7927, PR16247: Reimplement handling of matching extern "C" declarations across scopes. When we declare an extern "C" name that is not a redeclaration of an entity in the same scope, check whether it redeclares some extern "C" entity from another scope, and if not, check whether it conflicts with a (non-extern-"C") entity in the translation unit. When we declare a name in the translation unit that is not a redeclaration, check whether it conflicts with any extern "C" entities (possibly from other scopes). llvm-svn: 185281
* Revert r185229 as it breaks compilation of <windows.h>Timur Iskhodzhanov2013-06-291-47/+14
| | | | llvm-svn: 185256
* PR7927, PR16247: Reimplement handling of matching extern "C" declarationsRichard Smith2013-06-281-14/+47
| | | | | | | | | | | | | | | across scopes. When we declare an extern "C" name that is not a redeclaration of an entity in the same scope, check whether it redeclares some extern "C" entity from another scope, and if not, check whether it conflicts with a (non-extern-"C") entity in the translation unit. When we declare a name in the translation unit that is not a redeclaration, check whether it conflicts with any extern "C" entities (possibly from other scopes). llvm-svn: 185229
* DR14, DR101, and part of DR1: fix handling of extern "C" declarations inRichard Smith2013-06-181-3/+53
| | | | | | | namespaces, by treating them just like we treat extern "C" declarations in function scope. llvm-svn: 184223
* Add an interesting testcase we already handle correctly.Rafael Espindola2013-03-121-0/+12
| | | | llvm-svn: 176890
* Move the extern "C" sema tests to a new file.Rafael Espindola2013-03-121-0/+46
llvm-svn: 176888
OpenPOWER on IntegriCloud