summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Converted to use FileCheck.John Thompson2009-10-135-16/+26
| | | | llvm-svn: 84005
* Turn -Wparentheses on by default.John McCall2009-10-131-1/+1
| | | | llvm-svn: 83993
* Don't assume that the LHS and RHS of a member pointer expression is a ↵Anders Carlsson2009-10-131-0/+17
| | | | | | DeclRefExpr. Fixes PR5177. llvm-svn: 83986
* Diagnose attempts to add default function arguments to aDouglas Gregor2009-10-131-0/+30
| | | | | | specialization. This completes C++ [temp.expl.spec]! llvm-svn: 83980
* When explicitly specializing a member that is a template, mark theDouglas Gregor2009-10-132-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | template as a specialization. For example, this occurs with: template<typename T> struct X { template<typename U> struct Inner { /* ... */ }; }; template<> template<typename T> struct X<int>::Inner { T member; }; We need to treat templates that are member specializations as special in two contexts: - When looking for a definition of a member template, we look through the instantiation chain until we hit the primary template *or a member specialization*. This allows us to distinguish between the primary "Inner" definition and the X<int>::Inner definition, above. - When computing all of the levels of template arguments needed to instantiate a member template, don't add template arguments from contexts outside of the instantiation of a member specialization, since the user has already manually substituted those arguments. Fix up the existing test for p18, which was actually wrong (but we didn't diagnose it because of our poor handling of member specializations of templates), and add a new test for member specializations of templates. llvm-svn: 83974
* Improve the internal representation and semantic analysis of friendDouglas Gregor2009-10-132-0/+32
| | | | | | | | | | | | | | | function templates. This commit ensures that friend function templates are constructed as FunctionTemplateDecls rather than partial FunctionDecls (as they previously were). It then implements template instantiation for friend function templates, injecting the friend function template only when no previous declaration exists at the time of instantiation. Oh, and make sure that explicit specialization declarations are not friends. llvm-svn: 83970
* Refine handling for return value conversions with respect to virtualMike Stump2009-10-131-15/+92
| | | | | | offsets for covariant thunks. llvm-svn: 83965
* Teach sema and codegen about the difference between address of labels,Chris Lattner2009-10-131-1/+3
| | | | | | | | | | which is a common idiom to improve PIC'ness of code using the addr of label extension. This implementation is a gross hack, but the only other alternative would be to teach evalutate about this horrid combination. While GCC allows things like "&&foo - &&bar + 1", people don't use this in practice. This implements PR5131. llvm-svn: 83957
* merge an indirect goto test into statements, add anotherChris Lattner2009-10-132-4/+20
| | | | | | hairier (but nonsensical) example. llvm-svn: 83951
* test commitJohn Thompson2009-10-131-48/+47
| | | | llvm-svn: 83945
* add rdar # I accidentally lost.Chris Lattner2009-10-131-1/+1
| | | | llvm-svn: 83942
* merge two tests.Chris Lattner2009-10-132-19/+18
| | | | llvm-svn: 83941
* make the diagnostic in the 'unused result' warning more preciseChris Lattner2009-10-132-5/+9
| | | | | | about the reason, rdar://7186119. llvm-svn: 83940
* fix PR4938 by recognizing % as a modifier on outputs,Chris Lattner2009-10-131-0/+9
| | | | | | previously we only recognized it on inputs. llvm-svn: 83939
* Disable tests that check debug info intrinsic. This does not work if debug ↵Devang Patel2009-10-122-0/+2
| | | | | | info intrinsics are not used to encode debug info. llvm-svn: 83929
* When declaring a class template whose name is qualified, make sureDouglas Gregor2009-10-121-0/+16
| | | | | | | | that the scope in which it is being declared is complete. Also, when instantiating a member class template's ClassTemplateDecl, be sure to delay type creation so that the resulting type is dependent. Ick. llvm-svn: 83923
* Test explicit specialization involving multiple template<> headersDouglas Gregor2009-10-121-0/+12
| | | | llvm-svn: 83914
* Permit explicit specialization of member functions of class templatesDouglas Gregor2009-10-121-0/+26
| | | | | | | | that are declarations (rather than definitions). Also, be sure to set the access specifiers properly when instantiating the declarations of member function templates. llvm-svn: 83911
* Implement -Wparentheses: warn about using assignments in contexts that requireJohn McCall2009-10-121-0/+65
| | | | | | | | | conditions. Add a fixit to insert the parentheses. Also fix a very minor possible memory leak in 'for' conditions. Fixes PR 4876 and rdar://problem/7289172 llvm-svn: 83907
* Test explicit specializations of static data members that are declarations, ↵Douglas Gregor2009-10-121-0/+22
| | | | | | not definitions llvm-svn: 83904
* Yet another test for explicit specialization, this one involving linkageDouglas Gregor2009-10-121-0/+42
| | | | llvm-svn: 83901
* More tests for explicit template specializationDouglas Gregor2009-10-124-0/+35
| | | | llvm-svn: 83896
* Add test for last commitDouglas Gregor2009-10-121-0/+56
| | | | llvm-svn: 83893
* Diagnose the declaration of explicit specializations after an implicitDouglas Gregor2009-10-121-2/+4
| | | | | | | instantiation has already been required. To do so, keep track of the point of instantiation for anything that can be instantiated. llvm-svn: 83890
* Handle built-in unary operators when reporting ambiguities.Fariborz Jahanian2009-10-121-0/+18
| | | | | | wip - To prune excessive reporting. llvm-svn: 83889
* Fix test.Anders Carlsson2009-10-121-0/+1
| | | | llvm-svn: 83888
* Even more devirtualization cleverness.Anders Carlsson2009-10-121-0/+16
| | | | llvm-svn: 83886
* More devirtualization improvements.Anders Carlsson2009-10-121-0/+10
| | | | llvm-svn: 83883
* Devirtualize calls on temporaries. A().f() for example.Anders Carlsson2009-10-121-0/+3
| | | | llvm-svn: 83882
* Factor out devirtualization checking into a separate function and make it ↵Anders Carlsson2009-10-122-7/+18
| | | | | | handle references correctly. llvm-svn: 83880
* If built-in operators could not be selected because of ambiguity inFariborz Jahanian2009-10-122-4/+5
| | | | | | | | | | | | | | | | | | user-defined type conversions, issue list of ambiguites in addition to the diagnostic. So, clang now issues the following: b.cpp:19:19: error: left hand operand to ->* must be a pointer to class compatible with the right hand operand, but is 'struct C1' int i = c1->*pmf; ~~^ b.cpp:19:19: note: because of ambiguity in conversion of 'struct C1' to 'struct E *' b.cpp:5:5: note: candidate function operator E*(); ^ b.cpp:11:5: note: candidate function operator E*(); ^ llvm-svn: 83862
* If the base type of a member call is a record type we don't need to emit a ↵Anders Carlsson2009-10-111-1/+8
| | | | | | virtual call. llvm-svn: 83816
* Types appearing more than once in a spec shouldn't matter.Sebastian Redl2009-10-111-0/+4
| | | | llvm-svn: 83766
* Test exception spec compatibility on return type and parameters.Sebastian Redl2009-10-111-4/+4
| | | | | | | Along the way, use RequireCompleteType when testing exception spec types. Separate all the ugly spec stuff into its own file. llvm-svn: 83764
* Generate weak read barriers when reading a weak __blockFariborz Jahanian2009-10-101-0/+26
| | | | | | variable inside the block. llvm-svn: 83729
* Implement the core checking for compatible exception specifications in ↵Sebastian Redl2009-10-101-7/+7
| | | | | | | | | assignment and initialization. The exception specification of the assignee must be the same or a subset of the target. In addition, exception specifications on arguments and return types must be equivalent, but this is not implemented yet. This currently produces two diagnostics for every invalid assignment/initialization, due to the diagnostic produced outside PerformImplicitConversion, e.g. in CheckSingleInitializer. I don't know how to suppress this; in any case I think it is the wrong place for a diagnostic, since there are other diagnostics produced inside the function. So I'm leaving it as it is for the moment. llvm-svn: 83710
* Qualified lookup through using declarations. Diagnose a new type of ambiguity.John McCall2009-10-104-0/+166
| | | | | | | Split the various ambiguous result enumerators into their own enum. Tests for most of C++ [namespace.qual]. llvm-svn: 83700
* Check that the return type is complete when calling a member function.Anders Carlsson2009-10-101-1/+5
| | | | llvm-svn: 83694
* Add another test.Anders Carlsson2009-10-091-0/+16
| | | | llvm-svn: 83693
* Add CheckCallReturnType and start using it for regular call expressions. ↵Anders Carlsson2009-10-093-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | This will improve error messages. For struct B; B f(); void g() { f(); } We now get t.cpp:6:3: error: calling 'f' with incomplete return type 'struct B' f(); ^~~ t.cpp:3:3: note: 'f' declared here B f(); ^ t.cpp:1:8: note: forward declaration of 'struct B' struct B; ^ llvm-svn: 83692
* Refactor the LookupResult API to simplify most common operations. Require ↵John McCall2009-10-091-2/+2
| | | | | | | | | users to pass a LookupResult reference to lookup routines. Call out uses which assume a single result. llvm-svn: 83674
* When declaring a friend class template, we may end up finding anDouglas Gregor2009-10-091-0/+16
| | | | | | | | injected-class-name (e.g., when we're referring to other specializations of the current class template). Make sure that we see the template rather than the injected-class-name. Fixes PR4768. llvm-svn: 83672
* Produce good looking diagnostics on ambiguous built-in operators.Fariborz Jahanian2009-10-091-0/+24
| | | | | | | | | | | | | | Now we produce things like: bug1.cpp:21:11: error: use of overloaded operator '->*' is ambiguous int i = c->*pmf; // expected-error {{use of overloaded operator '->*' is ambiguous}} \ ~^ ~~~ bug1.cpp:21:11: note: built-in candidate operator ->* ('struct A volatile *', 'int const struct A::*') bug1.cpp:21:11: note: built-in candidate operator ->* ('struct A volatile *', 'int restrict struct A::*') ... Still need to look at an issue (indicated as FIXME in the test case). llvm-svn: 83650
* - Fixup SortCodeCompleteResult() to properly sort keywords on Mac OS ↵Steve Naroff2009-10-081-9/+9
| | | | | | | | (compare was system dependent). Worked on Linux, failed on Mac OS (which caused the recently added testcase to fail on Linux). - Sort results in testcase. llvm-svn: 83597
* Speed up testing by avoiding stdio.h, also helps testing on windows.Mike Stump2009-10-083-4/+3
| | | | | | Patch by John Thompson. llvm-svn: 83593
* Tests for C++ [expr], from James Porter!Douglas Gregor2009-10-083-0/+83
| | | | llvm-svn: 83588
* Tolerate .exe on executables. Patch by John Thompson. Changed * to .* by me.Mike Stump2009-10-081-2/+2
| | | | llvm-svn: 83586
* Tolerate .exe on executables. Patch by John Thompson.Mike Stump2009-10-081-2/+2
| | | | llvm-svn: 83584
* Fix up error reporting when object cannot be constructed Fariborz Jahanian2009-10-082-4/+4
| | | | | | | because of missing default constructor of a member. Fixes pr5154. llvm-svn: 83583
* In VC++, the *printf functions put an extra "0" in the exponent partMike Stump2009-10-081-5/+5
| | | | | | | of a floating point number. This add regular expressions to account for this. Patch by John Thompson. llvm-svn: 83581
OpenPOWER on IntegriCloud