summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/basic/basic.lookup/basic.lookup.qual
Commit message (Collapse)AuthorAgeFilesLines
* When diagnosing the lack of a viable conversion function, also listRichard Smith2020-01-091-1/+1
| | | | | | | | | | | | | | explicit functions that are not candidates. It's not always obvious that the reason a conversion was not possible is because the function you wanted to call is 'explicit', so explicitly say if that's the case. It would be nice to rank the explicit candidates higher in the diagnostic if an implicit conversion sequence exists for their arguments, but unfortunately we can't determine that without potentially triggering non-immediate-context errors that we're not permitted to produce.
* Restore pre-r335182 behavior for naming inherited constructors asRichard Smith2018-06-221-0/+15
| | | | | | | | | | | | | | members of dependent contexts. This permits cases where the names before and after the '::' in a dependent inherited constructor using-declaration do not match, but where we can nonetheless tell when parsing the template that a constructor is being named. Under (open) core language DR 2070, such cases will probably be ill-formed, but r335182 does not quite give that result and didn't intend to change this, so restore the old behavior for now. llvm-svn: 335381
* Add a "vexing parse" warning for ambiguity between a variable declaration and aRichard Smith2017-09-291-0/+1
| | | | | | | | | | | | | | function-style cast. This fires for cases such as T(x); ... where 'x' was previously declared and T is a type. This construct declares a variable named 'x' rather than the (probably expected) interpretation of a function-style cast of 'x' to T. llvm-svn: 314570
* Print nested name specifiers for typedefs and type aliasesAlex Lorenz2017-03-101-1/+1
| | | | | | | | | | | | Printing typedefs or type aliases using clang_getTypeSpelling() is missing the namespace they are defined in. This is in contrast to other types that always yield the full typename including namespaces. Patch by Michael Reiher! Differential Revision: https://reviews.llvm.org/D29944 llvm-svn: 297465
* Fix hole in our enforcement of rule requiring 'typename' prior to a dependentRichard Smith2017-02-011-2/+6
| | | | | | | | | | | name. If the dependent name happened to end in a template-id (X<T>::Y<U>), we would fail to notice that the 'typename' keyword is missing when resolving it to a type. It turns out that GCC has a similar bug. If this shows up in much real code, we can easily downgrade this to an ExtWarn. llvm-svn: 293815
* Finish implementation of C++ DR1310 (http://wg21.link/cwg1310).Richard Smith2017-01-201-3/+1
| | | | | | | Diagnose the case when a dependent template name instantiates to an injected-class-name outside a nested-name-specifier. llvm-svn: 292545
* PR13403 (+duplicates): implement C++ DR1310 (http://wg21.link/cwg1310).Richard Smith2017-01-191-4/+85
| | | | | | | | | | | | | | | | | | | | | | Under this defect resolution, the injected-class-name of a class or class template cannot be used except in very limited circumstances (when declaring a constructor, in a nested-name-specifier, in a base-specifier, or in an elaborated-type-specifier). This is apparently done to make parsing easier, but it's a pain for us since we don't know whether a template-id using the injected-class-name is valid at the point when we annotate it (we don't yet know whether the template-id will become part of an elaborated-type-specifier). As a tentative resolution to a perceived language defect, mem-initializer-ids are added to the list of exceptions here (they generally follow the same rules as base-specifiers). When the reference to the injected-class-name uses the 'typename' or 'template' keywords, we permit it to be used to name a type or template as an extension; other compilers also accept some cases in this area. There are also a couple of corner cases with dependent template names that we do not yet diagnose, but which will also get this treatment. llvm-svn: 292518
* P0136R1, DR1573, DR1645, DR1715, DR1736, DR1903, DR1941, DR1959, DR1991:Richard Smith2016-06-281-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace inheriting constructors implementation with new approach, voted into C++ last year as a DR against C++11. Instead of synthesizing a set of derived class constructors for each inherited base class constructor, we make the constructors of the base class visible to constructor lookup in the derived class, using the normal rules for using-declarations. For constructors, UsingShadowDecl now has a ConstructorUsingShadowDecl derived class that tracks the requisite additional information. We create shadow constructors (not found by name lookup) in the derived class to model the actual initialization, and have a new expression node, CXXInheritedCtorInitExpr, to model the initialization of a base class from such a constructor. (This initialization is special because it performs real perfect forwarding of arguments.) In cases where argument forwarding is not possible (for inalloca calls, variadic calls, and calls with callee parameter cleanup), the shadow inheriting constructor is not emitted and instead we directly emit the initialization code into the caller of the inherited constructor. Note that this new model is not perfectly compatible with the old model in some corner cases. In particular: * if B inherits a private constructor from A, and C uses that constructor to construct a B, then we previously required that A befriends B and B befriends C, but the new rules require A to befriend C directly, and * if a derived class has its own constructors (and so its implicit default constructor is suppressed), it may still inherit a default constructor from a base class llvm-svn: 274049
* [Lit Test] Updated 34 Lit tests to be C++11 compatible.Charles Li2015-11-171-2/+12
| | | | | | | Added expected diagnostics new to C++11. Expanded RUN line to: default, C++98/03 and C++11. llvm-svn: 253371
* 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
* This test should no longer be XFAILed; the standard has stabilized, and the ↵Aaron Ballman2014-05-301-13/+12
| | | | | | test contents are acceptable. No diagnostics expected from this test. llvm-svn: 209891
* Sema: Implement DR244David Majnemer2014-05-211-1/+2
| | | | | | | | | | | | | | | | Summary: Naming the destructor using a typedef-name for the class-name is well-formed. This fixes PR19620. Reviewers: rsmith, doug.gregor Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3583 llvm-svn: 209319
* Revert "Sema: Implement DR244"David Majnemer2014-05-031-2/+1
| | | | | | | | This was accidentally committed. This reverts commit r207892. llvm-svn: 207893
* Sema: Implement DR244David Majnemer2014-05-031-1/+2
| | | | | | | | | Naming the destructor using a typedef-name for the class-name is well-formed. This fixes PR19620. llvm-svn: 207892
* Don't fold together the name lookup entries for two declarations if they areRichard Smith2014-03-171-0/+11
| | | | | | declared in different namespaces in the same inline namespace set. llvm-svn: 204082
* Improve diagnostic for using non-class/namespace/scoped enum in a nested ↵David Blaikie2014-02-091-1/+2
| | | | | | | | | | | | | | | 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
* Remove FIXMEs: these are covered by a core issue which we don't yet implementRichard Smith2013-03-261-2/+0
| | | | | | (but we happen to get this part right). llvm-svn: 177958
* Implement special-case name lookup for inheriting constructors: memberRichard Smith2013-03-261-1/+93
| | | | | | | using-declarations with names which look constructor-like are interpreted as constructor names. llvm-svn: 177957
* Prior to adding the new "expected-no-diagnostics" directive to ↵Andy Gibbs2012-10-192-0/+2
| | | | | | VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. llvm-svn: 166280
* Update all tests other than Driver/std.cpp to use -std=c++11 rather thanRichard Smith2011-10-131-1/+1
| | | | | | -std=c++0x. Patch by Ahmed Charles! llvm-svn: 141900
* 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
* 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
* 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 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-232-0/+47
| | | | | | | | | | 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
* 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
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-154-4/+4
| | | | | | | | | - 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
* Improve on diagnosing type mismatches because of Fariborz Jahanian2009-11-181-3/+3
| | | | | | lack of viable convesion functions. llvm-svn: 89216
* 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
OpenPOWER on IntegriCloud