summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/member-pointer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert accidentally-committed test for PR27558 (which currently fails...)Richard Smith2016-05-191-9/+0
| | | | llvm-svn: 270010
* Make Sema::getPrintingPolicy less ridiculously expensive. This used to performRichard Smith2016-05-191-0/+9
| | | | | | | | | | an identifier table lookup, *and* copy the LangOptions (including various std::vector<std::string>s). Twice. We call this function once each time we start parsing a declaration specifier sequence, and once for each call to Sema::Diag. This reduces the compile time for a sample .c file from the linux kernel by 20%. llvm-svn: 270009
* [Lit Test] Updated 26 Lit tests to be C++11 compatible.Charles Li2015-11-111-2/+7
| | | | | | | 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
* Remove a recovery attempt that was untested and crashed when used.Nico Weber2015-02-171-0/+1
| | | | | | Found by SLi's bot. llvm-svn: 229532
* Handle unscoped enumeration in nested name specifier.Serge Pavlov2015-01-181-1/+2
| | | | | | | | | | If an unscoped enum is used as a nested name specifier and the language dialect is not C++ 11, issue an extension warning. This fixes PR16951. Differential Revision: http://reviews.llvm.org/D6389 llvm-svn: 226413
* Update error message text.Serge Pavlov2015-01-181-1/+1
| | | | | | | | | Previously if an enumeration was used in a nested name specifier in pre-C++11 language dialect, error message was 'XXX is not a class, namespace, or scoped enumeration'. This patch removes the word 'scoped' as in C++11 any enumeration may be used in this context. llvm-svn: 226410
* Improve diagnostic for using non-class/namespace/scoped enum in a nested ↵David Blaikie2014-02-091-1/+1
| | | | | | | | | | | | | | | name specifier. Rather than simply saying "X is not a class or namespace", clarify what X is by providing the aka type in the case where X is a type, or pointing to the named declaration if there's an unambiguous one to refer to. In the ambiguous case, the ambiguities are already enumerated (though could be clarified by describing what kind of entities they are) Included a few FIXMEs in tests where some further improvements could be made. llvm-svn: 201038
* PR17602: check accessibility when performing an implicit derived-to-baseRichard Smith2013-12-121-2/+6
| | | | | | | conversion on the LHS of a .* or ->*. Slightly improve diagnostics in case of an ambiguous base class. llvm-svn: 197125
* Teach the ARC compiler to not require __bridge casts whenJohn McCall2011-10-171-1/+1
| | | | | | | passing/receiving CF objects at +0 to/from Objective-C methods or audited C functions. llvm-svn: 142219
* Perform lvalue-to-rvalue conversions on both operands of ->*John McCall2011-06-301-0/+16
| | | | | | and the RHS of .*. Noticed by Enea Zaffanella! llvm-svn: 134170
* Classify bound member function types are member function types. FixesDouglas Gregor2011-05-211-0/+25
| | | | | | PR9973 / <rdar://problem/9479191>. llvm-svn: 131810
* There is no reason for dereferencing a pointer-to-member to requireDouglas Gregor2010-10-131-2/+3
| | | | | | | | | that the class type into which the pointer points be complete, even though the standard requires it. GCC/EDG do not require a complete type here, so we're calling this a problem with the standard. Fixes PR8328. llvm-svn: 116429
* Continue to instantiate sub-statements in a CompoundStmt as long asJohn McCall2010-08-271-3/+38
| | | | | | | we don't see a DeclStmt (failure to instantiate which generally causes panic). llvm-svn: 112282
* Propagate whether an id-expression is the immediate argument ofJohn McCall2010-08-271-3/+64
| | | | | | | | | | | | | | | | | | | an '&' expression from the second caller of ActOnIdExpression. Teach template argument deduction that an overloaded id-expression doesn't give a valid type for deduction purposes to a non-static member function unless the expression has the correct syntactic form. Teach ActOnIdExpression that it shouldn't try to create implicit member expressions for '&function', because this isn't a permitted form of use for member functions. Teach CheckAddressOfOperand to diagnose these more carefully. Some of these cases aren't reachable right now because earlier diagnostics interrupt them. llvm-svn: 112258
* Use CanQualType to enforce the use of a canonical type argument toDouglas Gregor2010-05-211-0/+17
| | | | | | | CXXBasePaths::isAmbiguous(), rather than just asserting that we have a canonical type. Fixes PR7176. llvm-svn: 104374
* Require a complete type for the lhs of member pointer dereference operations ↵Sebastian Redl2010-04-231-0/+10
| | | | | | if the type isn't exactly the same as the container class. Fixes PR6783. llvm-svn: 102186
* When a member pointer is dereferenced, the class it points into must be ↵Sebastian Redl2010-04-101-2/+2
| | | | | | complete. Enforce this. llvm-svn: 100925
* Improve diagnostics when we fail to convert from a source type to aDouglas Gregor2010-04-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | destination type for initialization, assignment, parameter-passing, etc. The main issue fixed here is that we used rather confusing wording for diagnostics such as t.c:2:9: warning: initializing 'char const [2]' discards qualifiers, expected 'char *' [-pedantic] char *name = __func__; ^ ~~~~~~~~ We're not initializing a 'char const [2]', we're initializing a 'char *' with an expression of type 'char const [2]'. Similar problems existed for other diagnostics in this area, so I've normalized them all with more precise descriptive text to say what we're initializing/converting/assigning/etc. from and to. The warning for the code above is now: t.c:2:9: warning: initializing 'char *' from an expression of type 'char const [2]' discards qualifiers [-pedantic] char *name = __func__; ^ ~~~~~~~~ Fixes <rdar://problem/7447179>. llvm-svn: 100832
* When pretty-printing tag types, only print the tag if we're in C (andJohn McCall2010-03-101-7/+7
| | | | | | | | | | therefore not creating ElaboratedTypes, which are still pretty-printed with the written tag). Most of these testcase changes were done by script, so don't feel too sorry for my fingers. llvm-svn: 98149
* Fix an assertion-on-error during tentative constructor parsing byJohn McCall2010-02-261-2/+1
| | | | | | | | | | propagating error conditions out of the various annotate-me-a-snowflake routines. Generally (but not universally) removes redundant diagnostics as well as, you know, not crashing on bad code. On the other hand, I have just signed myself up to fix fiddly parser errors for the next week. Again. llvm-svn: 97221
* Make Clang complain about taking the address of an unqualified member ↵Sebastian Redl2010-01-111-1/+13
| | | | | | function. Fixes PR5985. llvm-svn: 93150
* Initialization improvements: addition of string initialization and a fewEli Friedman2009-12-191-2/+2
| | | | | | | | small bug fixes in SemaInit, switch over SemaDecl to use it more often, and change a bunch of diagnostics which are different with the new initialization code. llvm-svn: 91767
* 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
* Implement [expr.mptr.oper]p6 for '->*' operator.Fariborz Jahanian2009-10-081-1/+1
| | | | llvm-svn: 83562
* Implement support for equality comparisons (!=, ==) of memberDouglas Gregor2009-08-241-0/+8
| | | | | | | | | | pointers, by extending the "composite pointer type" logic to include member pointer types. Introduce test cases for member pointer comparisons, including those that involve the builtin operator candidates implemented earlier. llvm-svn: 79925
* Make an error message more clear.Anders Carlsson2009-06-301-1/+1
| | | | llvm-svn: 74481
* Handle member pointer types with dependent class types (e.g., intDouglas Gregor2009-06-091-1/+2
| | | | | | T::*) and implement template instantiation for member pointer types. llvm-svn: 73151
* Implement explicit instantiations of member classes of class templates, e.g.,Douglas Gregor2009-05-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | template<typename T> struct X { struct Inner; }; template struct X<int>::Inner; This change is larger than it looks because it also fixes some a problem with nested-name-specifiers and tags. We weren't requiring the DeclContext associated with the scope specifier of a tag to be complete. Therefore, when looking for something like "struct X<int>::Inner", we weren't instantiating X<int>. This, naturally, uncovered a problem with member pointers, where we were requiring the left-hand side of a member pointer access expression (e.g., x->*) to be a complete type. However, this is wrong: the semantics of this expression does not require a complete type (EDG agrees). Stuart vouched for me. Blame him. llvm-svn: 71756
* Fix a minor edge case in C89 mode related to the definition of a Eli Friedman2009-04-281-1/+1
| | | | | | | | | | "function designator". (This causes a minor glitch in the diagnostics for C++ member pointers, but we weren't printing the right diagnostic there anyway.) llvm-svn: 70307
* Make sure to use RequireCompleteType rather than testing forDouglas Gregor2009-03-241-4/+4
| | | | | | | incomplete types. RequireCompleteType is needed when the type may be completed by instantiating a template. llvm-svn: 67643
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* Add negative test cases and fix diagnostics for member pointer dereferencing.Sebastian Redl2009-02-071-0/+23
| | | | llvm-svn: 63987
* Implement dereferencing of pointers-to-member.Sebastian Redl2009-02-071-0/+25
| | | | llvm-svn: 63983
* Implement taking address of member functions, including overloaded ones.Sebastian Redl2009-02-041-2/+21
| | | | llvm-svn: 63779
* Allow taking the address of data members, resulting in a member pointer.Sebastian Redl2009-02-031-0/+20
| | | | | | Pointers to functions don't work yet, and pointers to overloaded functions even less. Also, far too much illegal code is accepted. llvm-svn: 63655
* Implement pointer to member handling in static_cast.Sebastian Redl2009-01-281-0/+3
| | | | | | | Fix a stupid mistake in UnwrapSimilarPointers that made any two member pointers compatible as long as the pointee was the same. Make a few style corrections as suggested by Chris. llvm-svn: 63215
* Remove an implemented FIXME and extend test cases. Follow-up on Doug's review.Sebastian Redl2009-01-261-0/+7
| | | | llvm-svn: 63032
* Implement implicit conversions for pointers-to-member.Sebastian Redl2009-01-251-0/+13
| | | | llvm-svn: 62971
* Make tentative parsing of pointer-to-member decls work, and fix other stuff ↵Sebastian Redl2009-01-241-0/+5
| | | | | | pointed out by Doug. llvm-svn: 62944
* Add support for declaring pointers to members.Sebastian Redl2009-01-241-0/+14
Add serialization support for ReferenceType. llvm-svn: 62934
OpenPOWER on IntegriCloud