summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/basic
Commit message (Collapse)AuthorAgeFilesLines
...
* When emitting a "too many arguments to function call..." error, also include ↵Ted Kremenek2011-04-041-1/+1
| | | | | | a note with a location for the function prototype. llvm-svn: 128833
* Semantic checking for exception specifications should be triggered byJohn McCall2011-03-021-1/+1
| | | | | | whether C++ exceptions are enabled, not exceptions in general. PR9358. llvm-svn: 126820
* C++ [basic.scope.hiding] allows an ordinary name to hide a non-tagDouglas Gregor2010-10-231-0/+24
| | | | | | | name *in the same scope*, but not across scopes. Implement the highlighted condition. llvm-svn: 117212
* Always treat 'main' as an extern "C" function, so that we detectDouglas Gregor2010-10-211-0/+5
| | | | | | | | | redeclarations of main appropriately rather than allowing it to be overloaded. Also, disallowing declaring main as a template. Fixes GCC DejaGNU g++.old-deja/g++.other/main1.C. llvm-svn: 117029
* "const std::vector<int>*" not "std::vector<int> const*"Chris Lattner2010-09-051-1/+1
| | | | llvm-svn: 113094
* Rip out the C++0x-specific handling of destructor names. The specification ↵Sebastian Redl2010-07-071-0/+3
| | | | | | is still in flux and unclear, and our interim workaround was broken. Fixes PR7467. llvm-svn: 107835
* Add test case that I forgot to commit with r107354 (the implementationDouglas Gregor2010-07-011-0/+18
| | | | | | of C++ DR481). llvm-svn: 107359
* Add an extension to avoid an error when a global template has the same name asJeffrey Yasskin2010-06-051-0/+46
| | | | | | | | | | | | | | | | | | | | a member template, and you try to call the member template with an explicit template argument. See PR7247 For example, this downgrades the error to a warning in: template<typename T> struct set{}; struct Value { template<typename T> void set(T value) { } }; void foo() { Value v; v.set<double>(3.2); // Warning here. } llvm-svn: 105518
* A more minimal fix for PR6762.John McCall2010-05-281-0/+11
| | | | llvm-svn: 104991
* Roll back r104941.John McCall2010-05-281-11/+0
| | | | llvm-svn: 104990
* Add a new attribute on records, __attribute__((adl_invisible)), and defineJohn McCall2010-05-281-0/+11
| | | | | | | | | | | | the x86-64 __va_list_tag with this attribute. The attribute causes the affected type to behave like a fundamental type when considered by ADL. (x86-64 is the only target we currently provide with a struct-based __builtin_va_list) Fixes PR6762. llvm-svn: 104941
* Test case for r104938.John McCall2010-05-281-0/+11
| | | | llvm-svn: 104939
* When we've parsed a nested-name-specifier in a member accessDouglas Gregor2010-05-271-1/+1
| | | | | | | expression, "forget" about the object type; only the nested-name-specifier matters for name lookup purposes. Fixes PR7239. llvm-svn: 104834
* Fix ADL for types declared in transparent decls, from Alp Toker!Douglas Gregor2010-04-301-0/+15
| | | | llvm-svn: 102695
* Recommit my change to how C++ does elaborated type lookups, now withJohn McCall2010-04-231-0/+60
| | | | | | two bugfixes which fix selfhost and (hopefully) the nightly tests. llvm-svn: 102198
* Revert "C++ doesn't really use "namespaces" for different kinds of names the ↵Daniel Dunbar2010-04-231-52/+0
| | | | | | same", which seems to break most C++ nightly test apps. llvm-svn: 102174
* C++ doesn't really use "namespaces" for different kinds of names the sameJohn McCall2010-04-231-0/+52
| | | | | | | | | | | | | way that C does. Among other differences, elaborated type specifiers are defined to skip "non-types", which, as you might imagine, does not include typedefs. Rework our use of IDNS masks to capture the semantics of different kinds of declarations better, and remove most current lookup filters. Removing the last remaining filter is more complicated and will happen in a separate patch. Fixes PR 6885 as well some spectrum of unfiled bugs. llvm-svn: 102164
* Whenever we complain about a failed initialization of a function orDouglas Gregor2010-04-221-1/+1
| | | | | | | | | | | | | | | | | method parameter, provide a note pointing at the parameter itself so the user does not have to manually look for the function/method being called and match up parameters to arguments. For example, we now get: t.c:4:5: warning: incompatible pointer types passing 'long *' to parameter of type 'int *' [-pedantic] f(long_ptr); ^~~~~~~~ t.c:1:13: note: passing argument to parameter 'x' here void f(int *x); ^ llvm-svn: 102038
* When a template (without arguments) is passed as a template typeJeffrey Yasskin2010-04-081-2/+2
| | | | | | | parameter, explicitly ask the user to give it arguments. We used to complain that it wasn't a type and expect the user to figure it out. llvm-svn: 100729
* Put function templates instantiated from friend declarations in the correctJohn McCall2010-03-261-0/+12
| | | | | | lexical context. This is required for ADL to work properly; fixes PR6716. llvm-svn: 99665
* When a declaration of a function is missing an exception specificationDouglas Gregor2010-03-242-3/+19
| | | | | | | | | | | | | | | | | | | | | that was present in a prior declaration, emit a warning rather than a hard error (which we did before, and still do with mismatched exception specifications). Moreover, provide a fix-it hint with the throw() clause that should be added, e.g., t.C:10:7: warning: 'operator new' is missing exception specification 'throw(std::bad_alloc)' void *operator new(unsigned long sz) ^ throw(std::bad_alloc) As part of this, disable the warning when we're missing an exception specification on operator new, operator new[], operator delete, or operator delete[] when exceptions are turned off (-fno-exceptions). Fixes PR5957. llvm-svn: 99388
* When pretty-printing tag types, only print the tag if we're in C (andJohn McCall2010-03-101-2/+2
| | | | | | | | | | 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
* Implement crazy destructor name lookup semantics differently inDouglas Gregor2010-02-233-0/+77
| | | | | | | | | | C++98/03 and C++0x, since the '0x semantics break valid C++98/03 code. This new mess is tracked by core issue 399, which is still unresolved. Fixes PR6358 and PR6359. llvm-svn: 96836
* Check for redefinitions in MergeVarDecl. This finds redefinitions of globals ↵Sebastian Redl2010-02-021-0/+21
| | | | | | without an initializer in C++ and thus fixes PR5451. llvm-svn: 95098
* Fix two redefinitions in test cases that weren't diagnosed yet, but will be ↵Sebastian Redl2010-01-261-1/+1
| | | | | | soon. llvm-svn: 94565
* Reimplement constructor declarator parsing to cope with template-idsDouglas Gregor2010-01-131-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that name constructors, the endless joys of out-of-line constructor definitions, and various other corner cases that the previous hack never imagined. Fixes PR5688 and tightens up semantic analysis for constructor names. Additionally, fixed a problem where we wouldn't properly enter the declarator scope of a parenthesized declarator. We were entering the scope, then leaving it when we saw the ")"; now, we re-enter the declarator scope before parsing the parameter list. Note that we are forced to perform some tentative parsing within a class (call it C) to tell the difference between C(int); // constructor and C (f)(int); // member function which is rather unfortunate. And, although it isn't necessary for correctness, we use the same tentative-parsing mechanism for out-of-line constructors to improve diagnostics in icky cases like: C::C C::f(int); // error: C::C refers to the constructor name, but // we complain nicely and recover by treating it as // a type. llvm-svn: 93322
* Tweak the text of several main() diagnostics and punch a hole specifically forJohn McCall2009-12-241-1/+1
| | | | | | | | | | Darwin's sekrit fourth argument. This should probably be factored to let targets make target-specific decisions about what main() should look like. Fixes rdar://problem/7414990 or if different platforms have radically different ideas of what they want in llvm-svn: 92128
* Switch Sema::AddCXXDirectInitializerToDecl over to InitializationSequenceDouglas Gregor2009-12-221-1/+1
| | | | llvm-svn: 91927
* Enter the scope of an initializer for direct-initialization as well asDouglas Gregor2009-12-221-0/+2
| | | | | | for copy-initialization. llvm-svn: 91909
* Don't inject the class name until that magical lbrace.John McCall2009-12-201-0/+8
| | | | | | | | | | | | | | | | Because of the rules of base-class lookup* and the restrictions on typedefs, it was actually impossible for this to cause any problems more serious than the spurious acceptance of template <class T> class A : B<A> { ... }; instead of template <class T> class A : B<A<T> > { ... }; but I'm sure we can all agree that that is a very important restriction which is well worth making another Parser->Sema call for. (*) n.b. clang++ does not implement these rules correctly; we are not ignoring non-type names llvm-svn: 91792
* Test the lookup I wasn't sure would be done properly after the last patch.John McCall2009-12-201-5/+25
| | | | | | | | | Clang reasonably adds all the base specifiers in one pass; this is now required for correctness to prevent lookup from going mad. But this has the advantage of establishing the correct context when looking up base specifiers, which will be important for access control. llvm-svn: 91791
* Parse base specifiers within the scope of the class. This is possibly notJohn McCall2009-12-191-0/+9
| | | | | | quite right; I'll come back to it later. It does fix PR 5741. llvm-svn: 91789
* Just push a new scope when parsing an out-of-line variable definition.John McCall2009-12-191-1/+6
| | | | | | | Magically fixes all the terrible lookup problems associated with not pushing a new scope. Resolves an ancient xfail and an LLVM misparse. llvm-svn: 91769
* Introduce a centralized routine in Sema for diagnosing failed lookups (whenJohn McCall2009-12-161-1/+1
| | | | | | | | | used as expressions). In dependent contexts, try to recover by doing a lookup in previously-dependent base classes. We get better diagnostics out, but unfortunately the recovery fails: we need to turn it into a method call expression, not a bare call expression. Thus this is still a WIP. llvm-svn: 91525
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-1529-29/+29
| | | | | | | | | - 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
* Fix test.Anders Carlsson2009-12-131-1/+1
| | | | llvm-svn: 91245
* More improvements to checking allocation and deallocation functions.Anders Carlsson2009-12-131-0/+32
| | | | llvm-svn: 91244
* Correctly diagnose [basic.stc.dynamic.allocation]p1Anders Carlsson2009-12-121-0/+12
| | | | llvm-svn: 91190
* Improve diagnostics for malformed delete operator function declarations.Anders Carlsson2009-12-111-0/+11
| | | | llvm-svn: 91180
* Use a more rigorous definition of 'class member'. I don't have any evidenceJohn McCall2009-12-021-0/+20
| | | | | | that this was causing a problem, but it could have. llvm-svn: 90343
* Implement the rules in C++ [basic.link] and C99 6.2.2 for computingDouglas Gregor2009-11-251-0/+11
| | | | | | | | | | | the linkage of a declaration. Switch the lame (and completely wrong) NamedDecl::hasLinkage() over to using the new NamedDecl::getLinkage(), along with the "can this declaration be a template argument?" check that started all of this. Fixes -fsyntax-only for PR5597. llvm-svn: 89891
* Tweak expected error message, although we still fail this testDouglas Gregor2009-11-251-1/+1
| | | | llvm-svn: 89875
* Improve on diagnosing type mismatches because of Fariborz Jahanian2009-11-181-3/+3
| | | | | | lack of viable convesion functions. llvm-svn: 89216
* Simple test case for [basic.lookup.udir].John McCall2009-11-101-0/+35
| | | | llvm-svn: 86674
* Switch XFAIL format to match LLVM.Daniel Dunbar2009-11-032-2/+2
| | | | llvm-svn: 85880
* 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
* Spell clang-cc correctly.Daniel Dunbar2009-09-221-1/+1
| | | | llvm-svn: 82582
* When implicitly declaring operators new, new[], delete, and delete[],Douglas Gregor2009-09-152-0/+32
| | | | | | | | | | | | give them the appropriate exception specifications. This, unfortunately, requires us to maintain and/or implicitly generate handles to namespace "std" and the class "std::bad_alloc". However, every other approach I've come up with was more hackish, and this standard requirement itself is quite the hack. Fixes PR4829. llvm-svn: 81939
* Track a class template specialization's point of instantiation separatelyJohn McCall2009-09-111-4/+2
| | | | | | | | | | from its location. Initialize appropriately. When implicitly creating a declaration of a class template specialization after encountering the first reference to it, use the pattern class's location instead of the location of the first reference. llvm-svn: 81515
* Support elaborated dependent types and diagnose tag mismatches.John McCall2009-09-111-1/+3
| | | | llvm-svn: 81504
OpenPOWER on IntegriCloud