summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/linkage-spec.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Retain previous language linkage of friend function declarationsAlp Toker2013-10-221-0/+19
| | | | | | | | | | | | | | | | | | With this extension, friend function declarations will retain the language linkage specified for previous declarations instead of emitting an error diagnostic. The feature is known to be compatible with GCC and MSVC and permits a language to be specified indirectly where it cannot otherwise be written directly in class scope. Work is ongoing to improve linkage spec diagnostics. Fixes PR17337. Reviewed by Richard Smith. llvm-svn: 193206
* Reinstate r185229, reverted in r185256, with a tweak: further ignore theRichard Smith2013-06-301-1/+38
| | | | | | | | | | | | | | | | | | | | | | | 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-40/+3
| | | | llvm-svn: 185256
* PR7927, PR16247: Reimplement handling of matching extern "C" declarationsRichard Smith2013-06-281-3/+40
| | | | | | | | | | | | | | | 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
* Put the PR16167 tests togetherDavid Majnemer2013-05-311-0/+1
| | | | llvm-svn: 183046
* Disallow extern decls of type void in C++ modeDavid Majnemer2013-05-291-0/+2
| | | | | | | C++ and C differ with respect to the handling of extern void declarations. Enforce the C++ behavior in C++ mode. llvm-svn: 182814
* Use lexical contexts when checking for conflicting language linkages.Rafael Espindola2013-05-051-0/+8
| | | | | | | This fixes pr14958. I will audit other calls to isExternCContext to see if there are any similar bugs left. llvm-svn: 181163
* Don't special case one line extern "C" decls.Rafael Espindola2013-03-291-0/+4
| | | | | | | | | | | | | | We already avoided warning for extern "C" const char *Version_string = "2.9"; now we also don't produce any warnings for extern "C" { extern const char *Version_string2 = "2.9"; } llvm-svn: 178333
* Push "out-of-line" declarations into scope when their lexical/semanticDouglas Gregor2011-10-091-0/+13
| | | | | | | redeclaration contexts are the same, as occurs within linkage specifications. Fixes PR9162. llvm-svn: 141521
* Don't complain about a variable within a linkage-specification that isDouglas Gregor2010-10-151-0/+3
| | | | | | initialized. Fixes PR7076. llvm-svn: 116553
* Parse all kinds of declarations as part of a linkage-specification,Douglas Gregor2010-08-241-0/+9
| | | | | | from Francois Pichet! Fixes PR7754. llvm-svn: 111912
* A member function never has "C" linkage. Fixes <rdar://problem/8318976>.Douglas Gregor2010-08-171-0/+9
| | | | llvm-svn: 111238
* Handle the obvious case for diagnosing redeclarations of extern "C" functions.John McCall2010-08-121-0/+11
| | | | | | Fixes PR7859. llvm-svn: 110906
* Fixed typedef inside extern "C".Abramo Bagnara2010-07-301-0/+3
| | | | llvm-svn: 109865
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* When performing unqualified name lookup in C++, don't look directlyDouglas Gregor2009-12-081-0/+14
| | | | | | | into transparent contexts; instead, we'll look into their nearest enclosing non-transparent contexts further up the stack. Fixes PR5479. llvm-svn: 90859
* When checking the namespace of a redeclaration or definition, look through ↵Sebastian Redl2009-11-081-0/+7
| | | | | | linkage specs. Fixes PR5430. llvm-svn: 86461
* Eliminate &&s in tests.Daniel Dunbar2009-11-081-1/+1
| | | | | | - 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious. llvm-svn: 86430
* Skip transparent contexts when performing C++ name lookupDouglas Gregor2009-08-241-0/+8
| | | | llvm-svn: 79931
* Fix another case where the extern-ness of extern "C" wasn't being captured. Anders Carlsson2009-05-161-0/+4
| | | | | | This makes me think that we should make hasExternalStorage perform this check... llvm-svn: 71962
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* When determining whether a variable is a file-scoped variable, checkDouglas Gregor2009-01-071-0/+6
| | | | | | | out its lookup context (to see through linkage specifications). Addresses <rdar://problem/6477142>. llvm-svn: 61848
* Add forgotten test case for linkage specificationsDouglas Gregor2009-01-051-0/+17
llvm-svn: 61737
OpenPOWER on IntegriCloud