summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/addr-of-overloaded-function.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Lit Test] Updated 26 Lit tests to be C++11 compatible.Charles Li2015-11-111-1/+6
| | | | | | | Expected diagnostics have been expanded to vary by C++ dialect. RUN line has also been expanded to: default, C++98/03 and C++11. llvm-svn: 252785
* [Sema] Don't emit multiple diags for one errorGeorge Burgess IV2015-10-121-7/+3
| | | | | | | | | Fixed a bug where we'd emit multiple diagnostics if there was a problem taking the address of an overloaded template function. Differential Revision: http://reviews.llvm.org/D13664 llvm-svn: 250078
* TypePrinter print __restrict if not in C99 modeJacques Pienaar2015-03-031-4/+4
| | | | | | | | | | | | | | restrict is a keyword in C99 but not in C++ while clang accepts __restrict for C++ code. Modify the TypePrinter to print __restrict when not processing C99 code. Printing restrict in C++ was problematic as printing the argument of int f(int * __restrict a) { ... } resulted in int *restrict a which is incorrect. http://reviews.llvm.org/D8048 llvm-svn: 231179
* Revert "Don't require -re suffix on -verify directives with regexes."Alp Toker2013-12-141-10/+10
| | | | | | | | | | This patch was submitted to the list for review and didn't receive a LGTM. (In fact one explicit objection and one query were raised.) This reverts commit r197295. llvm-svn: 197299
* Don't require -re suffix on -verify directives with regexes.Hans Wennborg2013-12-141-10/+10
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2392 llvm-svn: 197295
* Tighten test regexes checking for __attribute__((thiscall)) on function types.Hans Wennborg2013-12-131-8/+8
| | | | | | | | | | | The tests were perhaps made too relaxed in r197164 when we switched to the new MinGW ABI. This makes sure we check explicitly for an optional thiscall attribute and nothing else. We should still look into whether we should print these attributes at all in these cases. llvm-svn: 197252
* Switch to the new MingW ABI.Rafael Espindola2013-12-121-8/+8
| | | | | | | GCC 4.7 changed the MingW ABI. On the clang side this means that methods now have the thiscall calling convention by default. llvm-svn: 197164
* Change semantics of regex expectations in the diagnostic verifierHans Wennborg2013-12-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Previously, a line like // expected-error-re {{foo}} treats the entirety of foo as a regex. This is inconvenient when matching type names containing regex characters. For example, to match "void *(class test8::A::*)(void)" inside such a regex, one would have to type "void \*\(class test8::A::\*\)\(void\)". This patch changes the semantics of expected-error-re to only treat the parts of the directive wrapped in double curly braces as regexes. This avoids the escaping problem and leads to nicer patterns for those cases; see e.g. the change to test/Sema/format-strings-scanf.c. (The balanced search for closing }} of a directive also makes us handle the full directive in test\SemaCXX\constexpr-printing.cpp:41 and :53.) Differential Revision: http://llvm-reviews.chandlerc.com/D2388 llvm-svn: 197092
* Fix crash typo-correcting dependent member func.Eli Friedman2013-07-081-0/+4
| | | | | | PR16561. llvm-svn: 185887
* Provide suggested no-arg calls for overloaded member functions missing callsDavid Blaikie2013-06-211-1/+27
| | | | | | Reviewed by Richard Smith. llvm-svn: 184612
* Bound member function diagnostic - suggest no-args calls and note overload ↵David Blaikie2013-06-041-3/+4
| | | | | | | | | | candidates Still missing cases for templates, but this is a step in the right direction. Also omits suggestions that would be ambiguous (eg: void func(int = 0); + void func(float = 0); func;) llvm-svn: 183173
* Modify how the -verify flag works. Currently, the verification string andRichard Trieu2011-12-151-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | diagnostic message are compared. If either is a substring of the other, then no error is given. This gives rise to an unexpected case: // expect-error{{candidate function has different number of parameters}} will match the following error messages from Clang: candidate function has different number of parameters (expected 1 but has 2) candidate function has different number of parameters It will also match these other error messages: candidate function function has different number of parameters number of parameters This patch will change so that the verification string must be a substring of the diagnostic message before accepting. Also, all the failing tests from this change have been corrected. Some stats from this cleanup: 87 - removed extra spaces around verification strings 70 - wording updates to diagnostics 40 - extra leading or trailing characters (typos, unmatched parens or quotes) 35 - diagnostic level was included (error:, warning:, or note:) 18 - flag name put in the warning (-Wprotocol) llvm-svn: 146619
* Make the diagnostic message more consistant. Update the type comparison toRichard Trieu2011-12-131-1/+1
| | | | | | | handle non-pointer types. This is for the extra info printed when function types are compared. llvm-svn: 146525
* Add feature to diagnostics that will provide more information on functionRichard Trieu2011-11-231-0/+61
| | | | | | | | | | pointer mismatch. Cases covered are: initialization, assignment, and function arguments. Additional text will give the extra information about the nature of the mismatch: different classes for member functions, wrong number of parameters, different parameter type, different return type, and function qualifier mismatch. llvm-svn: 145114
* Teach the ARC compiler to not require __bridge casts whenJohn McCall2011-10-171-2/+1
| | | | | | | passing/receiving CF objects at +0 to/from Objective-C methods or audited C functions. llvm-svn: 142219
* Make yet another placeholder type, this one marking that an expression is a ↵John McCall2011-04-261-3/+4
| | | | | | | | | | | bound member function, i.e. something of the form 'x.f' where 'f' is a non-static member function. Diagnose this in the general case. Some of the new diagnostics are probably worse than the old ones, but we now get this right much more universally, and there's certainly room for improvement in the diagnostics. llvm-svn: 130239
* Handle the resolution of a reference to a function template (whichDouglas Gregor2011-02-191-3/+3
| | | | | | | | includes explicitly-specified template arguments) to a function template specialization in cases where no deduction is performed or deduction fails. Patch by Faisal Vali, fixes PR7505! llvm-svn: 126048
* When attempting reference binding to an overloaded function, alsoDouglas Gregor2010-11-081-0/+29
| | | | | | | consider that we might be trying to bind a reference to a class type, which involves a constructor call. Fixes PR7425. llvm-svn: 118407
* Properly diagnose invalid casts to function references. Patch byDouglas Gregor2010-11-081-6/+6
| | | | | | Faisal Vali, tweaked by me. Fixes PR8230. llvm-svn: 118400
* When performing template argument deduction of a function templateDouglas Gregor2010-09-291-0/+12
| | | | | | | | against a function type, be sure to check the type of the resulting function template specialization against the desired function type after substituting the deduced/defaulted template arguments. Fixes PR8196. llvm-svn: 115086
* Don't assert when attempting to take the address of an overloadedDouglas Gregor2010-09-121-0/+8
| | | | | | | function fails due to ambiguities in partial ordering of function templates. Fixes PR8033. llvm-svn: 113725
* PR7971: Compute the correct type for an address-of expression containing anEli Friedman2010-08-241-0/+10
| | | | | | UnresolvedMemberExpr. llvm-svn: 111899
* Use the naming class from the overloaded lookup when access-checking anJohn McCall2010-04-221-0/+16
| | | | | | | | | | address of overloaded function, instead of assuming that a nested name specifier was used. A nested name specifier is not required for static functions. Fixes PR6886. llvm-svn: 102107
* Always diagnose and complain about problems inDouglas Gregor2010-04-141-0/+16
| | | | | | | | | | ResolveAddressOfOverloadedFunction when asked to complain. Previously, we had some weird handshake where ResolveAddressOfOverloadedFunction expected its caller to handle some of the diagnostics but not others, and yet there was no way for the caller to know which case we were in. Eliminate this madness, fixing <rdar://problem/7765884>. llvm-svn: 101312
* Switch file-scope assignment initialization over to InitializationSequence.Eli Friedman2009-12-221-1/+1
| | | | llvm-svn: 91881
* 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
* Handle MemberExprs in ResolveAddressOfOverloadedFunction.Anders Carlsson2009-10-071-0/+10
| | | | llvm-svn: 83495
* Slightly improve the test for partial ordering of overloaded functionDouglas Gregor2009-09-141-3/+5
| | | | | | templates. llvm-svn: 81806
* Test function template partial ordering when resolving the address ofDouglas Gregor2009-09-141-0/+15
| | | | | | an overloaded function (template). llvm-svn: 81804
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* Basic support for taking the address of an overloaded functionDouglas Gregor2008-11-101-0/+29
llvm-svn: 59000
OpenPOWER on IntegriCloud