summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaCXXScopeSpec.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* In C++11 mode, implement the C++11 semantics forDouglas Gregor2012-05-011-2/+5
| | | | | | | | | | | [basic.lookup.classref]p1 and p4, which concerns name lookup for nested-name-specifiers and template names, respectively, in a member access expression. C++98/03 forces us to look both in the scope of the object and in the current scope, then compare the results. C++11 just takes the result from the scope of the object, if something is found. Fixes <rdar://problem/11328502>. llvm-svn: 155935
* Support for definitions of member enumerations of class templates outside theRichard Smith2012-03-231-4/+8
| | | | | | | class template's definition, and for explicit specializations of such enum members. llvm-svn: 153304
* Instantiating a class template should not instantiate the definition of anyRichard Smith2012-03-141-31/+41
| | | | | | | | scoped enumeration members. Later uses of an enumeration temploid as a nested name specifier should cause its instantiation. Plus some groundwork for explicit specialization of member enumerations of class templates. llvm-svn: 152750
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-7/+7
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Added source location for the template keyword in ↵Abramo Bagnara2012-02-061-0/+1
| | | | | | | | | | DependentTemplateSpecializationTypeLoc nodes (DTSTLoc). The new info is propagated to TSTLoc on template instantiation, getting rid of 3 FIXMEs in TreeTransform.h and another one Parser.cpp. Simplified code in TypeSpecLocFiller visitor methods for DTSTLoc and DependentNameTypeLoc by removing what now seems to be dead code (adding corresponding assertions). llvm-svn: 149923
* Added location for template keyword in TemplateSpecializationTypeLoc. In the ↵Abramo Bagnara2012-02-061-9/+8
| | | | | | process removed some naming ambiguities. llvm-svn: 149870
* Make the callback object to Sema::CorrectTypo mandatory.Kaelyn Uhrain2012-01-311-1/+1
| | | | llvm-svn: 149451
* Added source location for the template keyword in AST template-id expressions.Abramo Bagnara2012-01-271-4/+4
| | | | llvm-svn: 149127
* Remove unreachable code in Clang. (replace with llvm_unreachable where ↵David Blaikie2012-01-171-5/+3
| | | | | | appropriate or when GCC requires it) llvm-svn: 148292
* Convert SemaCXXScopeSpec.cpp to pass a callback object to CorrectTypo,Kaelyn Uhrain2012-01-121-3/+22
| | | | | | improvng the typo correction results in certain situations. llvm-svn: 148052
* Support decltype in nested-name-specifiers.David Blaikie2011-12-041-0/+23
| | | | llvm-svn: 145785
* Add -Wc++98-compat warning for enumerations in nested name specifiers.Richard Smith2011-10-201-0/+3
| | | | llvm-svn: 142568
* -Wc++98-compat and -Wc++98-compat-pedantic warnings for Sema, part 2.Richard Smith2011-10-181-1/+1
| | | | llvm-svn: 142426
* Rename TagDecl::isDefinition -> isCompleteDefinitionJohn McCall2011-10-071-1/+1
| | | | | | | for better self-documenting code, since the semantics are subtly different from getDefinition(). llvm-svn: 141355
* Removing a bunch of dead returns/breaks after llvm_unreachables.David Blaikie2011-09-231-1/+0
| | | | llvm-svn: 140407
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-1/+1
| | | | llvm-svn: 140367
* Rename LangOptions::Microsoft to LangOptions::MicrosoftExt to make it clear ↵Francois Pichet2011-09-171-1/+1
| | | | | | | | that this flag must be used only for Microsoft extensions and not emulation; to avoid confusion with the new LangOptions::MicrosoftMode flag. Many of the code now under LangOptions::MicrosoftExt will eventually be moved under the LangOptions::MicrosoftMode flag. llvm-svn: 139987
* In Microsoft mode, if we are within a templated function and we can't ↵Francois Pichet2011-07-271-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | resolve Identifier during BuildCXXNestedNameSpecifier, then extend the SS with Identifier. This will have the effect of resolving Identifier during template instantiation. The goal is to be able to resolve a function call whose nested-name-specifier is located inside a dependent base class. class C { public: static void foo2() { } }; template <class T> class A { public: typedef C D; }; template <class T> class B : public A<T> { public: void foo() { D::foo2(); } }; Note that this won't work if the NestedNameSpecifier refers to a type. This fixes 1 error when parsing the MSVC 2010 standard headers file with clang. llvm-svn: 136203
* Fixed enum types can be complete without actually being valid to useJohn McCall2011-07-061-6/+21
| | | | | | | as scope specifiers; diagnose the attempt, rather than letting it go to an assert. The rest of PR10264. llvm-svn: 134479
* Add support for C++ namespace-aware typo correction, e.g., correctingDouglas Gregor2011-06-281-14/+17
| | | | | | | | | | | | | | | vector<int> to std::vector<int> Patch by Kaelyn Uhrain, with minor tweaks + PCH support from me. Fixes PR5776/<rdar://problem/8652971>. Thanks Kaelyn! llvm-svn: 134007
* When checking a set of template parameter lists against aDouglas Gregor2011-05-151-1/+1
| | | | | | | | | nested-name-specifier, re-evaluate the nested-name-specifier as if we were entering that context (which we did!), so that we'll resolve a template-id to a particular class template partial specialization. Fixes PR9913. llvm-svn: 131383
* Implement support for C++0x alias templates.Richard Smith2011-05-051-6/+15
| | | | llvm-svn: 130953
* Clean up Sema::BuildCXXNestedNameSpecifier()'s creation of TypeLocDouglas Gregor2011-05-041-7/+15
| | | | | | | | information. Rather than looking at the declaration kind to figure out what TypeLoc to build, look at the type; it makes so much more sense. Fixes <rdar://problem/9086649>. llvm-svn: 130882
* Support for C++11 (non-template) alias declarations.Richard Smith2011-04-151-2/+2
| | | | llvm-svn: 129567
* Teach Sema::ActOnCXXNestedNameSpecifier and Sema::CheckTemplateIdTypeDouglas Gregor2011-03-041-0/+13
| | | | | | | | to cope with non-type templates by providing appropriate errors. Previously, we would either assert, crash, or silently build a dependent type when we shouldn't. Fixes PR9226. llvm-svn: 127037
* Push nested-name-specifier source-location information into dependentDouglas Gregor2011-03-011-3/+3
| | | | | | | | template specialization types. There are still a few rough edges to clean up with some of the parser actions dropping nested-name-specifiers too early. llvm-svn: 126776
* Reinstate the introduction of source-location information forDouglas Gregor2011-03-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | nested-name-speciciers within elaborated type names, e.g., enum clang::NestedNameSpecifier::SpecifierKind Fixes in this iteration include: (1) Compute the type-source range properly for a dependent template specialization type that starts with "template template-id ::", as in a member access expression dep->template f<T>::f() This is a latent bug I triggered with this change (because now we're checking the computed source ranges for dependent template specialization types). But the real problem was... (2) Make sure to set the qualifier range on a dependent template specialization type appropriately. This will go away once we push nested-name-specifier locations into dependent template specialization types, but it was the source of the valgrind errors on the buildbots. llvm-svn: 126765
* When we encounter a dependent template name within aDouglas Gregor2011-02-281-7/+60
| | | | | | | | | | | | nested-name-specifier, e.g., T::template apply<U>:: represent the dependent template name specialization as a DependentTemplateSpecializationType, rather than a TemplateSpecializationType with a dependent TemplateName. llvm-svn: 126593
* Retain complete source-location information for C++Douglas Gregor2011-02-241-0/+35
| | | | | | | | | | | | nested-name-specifiers throughout the parser, and provide a new class (NestedNameSpecifierLoc) that contains a nested-name-specifier along with its type-source information. Right now, this information is completely useless, because we don't actually store the source-location information anywhere in the AST. Call this Step 1/N. llvm-svn: 126391
* Teach NestedNameSpecifier to keep track of namespace aliases the sameDouglas Gregor2011-02-241-4/+5
| | | | | | | | way it keeps track of namespaces. Previously, we would map from the namespace alias to its underlying namespace when building a nested-name-specifier, losing source information in the process. llvm-svn: 126358
* Teach CXXScopeSpec to handle the extension of a nested-name-specifierDouglas Gregor2011-02-241-85/+130
| | | | | | | | | with another component in the nested-name-specifiers, updating its representation (a NestedNameSpecifier) and source-location information (currently a SourceRange) simultaneously. This is groundwork for adding source-location information to nested-name-specifiers. llvm-svn: 126346
* The member classes of a current instantiation aren't necessarily aDouglas Gregor2011-02-191-8/+21
| | | | | | | | | | | current instantiation, even though we have a RecordDecl describing them. Fixes PR9255. Amusingly, I've had this patch sitting around for a month or two because it was "obviously" wrong, but hadn't gotten around to writing a test case to submit the fix :) llvm-svn: 126038
* Change QualType::getTypePtr() to return a const pointer, then change aJohn McCall2011-01-191-1/+0
| | | | | | thousand other things which were (generally inadvertantly) relying on that. llvm-svn: 123814
* Rename DeclContext::getLookupContext to getRedeclContext and change its ↵Sebastian Redl2010-08-311-1/+1
| | | | | | semantics slightly. No functionality change in the absence of inline namespaces. Also, change a few places where inline namespaces actually make a difference to be prepared for them. llvm-svn: 112563
* Split out a header to hold APIs meant for the Sema implementation from Sema.h.John McCall2010-08-251-1/+1
| | | | | | | Clients of Sema don't need to know (for example) the list of diagnostics we support. llvm-svn: 112093
* Abstract out passing around types and kill off ActionBase.John McCall2010-08-241-8/+7
| | | | llvm-svn: 111901
* Another step in the process of making the parser depend on Sema:John McCall2010-08-201-1/+1
| | | | | | | | | - move DeclSpec &c into the Sema library - move ParseAST into the Parse library Reflect this change in a thousand different includes. Reflect this change in the link orders. llvm-svn: 111667
* Move Sema's headers into include/clang/Sema, renaming a few along the way.Douglas Gregor2010-08-121-2/+2
| | | | llvm-svn: 110945
* When a nested-name-specifier refers into a current instantiation that hasDouglas Gregor2010-07-281-6/+13
| | | | | | | | dependent bases, construct a dependent nested-name-specifier rather than complaining that the name could not be found within the current instantiation itself. Fixes PR7725. llvm-svn: 109582
* When performing substitution of template arguments within the body ofDouglas Gregor2010-07-081-1/+1
| | | | | | | a template, be sure to include the template arguments from the injected-class-name. Fixes PR7587. llvm-svn: 107895
* When typo correction produces a result that is not of the kind we'reDouglas Gregor2010-06-291-1/+3
| | | | | | | looking for, reset the name within the LookupResult structure in addition to clearing out the results. Fixes PR7508. llvm-svn: 107197
* It turns out that basically every caller to RequireCompleteDeclContextJohn McCall2010-05-011-18/+9
| | | | | | | already knows what context it's looking in. Just pass that context in instead of (questionably) recalculating it. llvm-svn: 102818
* Make the InjectedClassNameType the canonical type of the current instantiationJohn McCall2010-04-271-55/+16
| | | | | | | | | | | | | | | | of a class template or class template partial specialization. That is to say, in template <class T> class A { ... }; or template <class T> class B<const T*> { ... }; make 'A<T>' and 'B<const T*>' sugar for the corresponding InjectedClassNameType when written inside the appropriate context. This allows us to track the current instantiation appropriately even inside AST routines. It also allows us to compute a DeclContext for a type much more efficiently, at some extra cost every time we write a template specialization (which can be optimized, but I've left it simple in this patch). llvm-svn: 102407
* Be more careful around dependent nested-name-specifiers, complainingDouglas Gregor2010-04-241-0/+10
| | | | | | | | when they are not complete (since we could not match them up to anything) and ensuring that enum parsing can cope with dependent elaborated-type-specifiers. Fixes PR6915 and PR6649. llvm-svn: 102247
* Teach typo correction about various language keywords. We can'tDouglas Gregor2010-04-141-1/+2
| | | | | | | | | | | | | generally recover from typos in keywords (since we would effectively have to mangle the token stream). However, there are still benefits to typo-correcting with keywords: - We don't make stupid suggestions when the user typed something that is similar to a keyword. - We can suggest the keyword in a diagnostic (did you mean "static_cast"?), even if we can't recover and therefore don't have a fix-it. llvm-svn: 101274
* Make CXXScopeSpec invalid when incomplete, and propagate that into anyJeffrey Yasskin2010-04-081-10/+13
| | | | | | | Declarator that depends on it. This fixes several redundant errors and bad recoveries. llvm-svn: 100779
* Reinstate my CodeModificationHint -> FixItHint renaming patch, withoutDouglas Gregor2010-03-311-4/+4
| | | | | | the C-only "optimization". llvm-svn: 100022
* Revert r100008, which inexplicably breaks the clang-i686-darwin10 builderDouglas Gregor2010-03-311-4/+4
| | | | llvm-svn: 100018
* Rename CodeModificationHint to FixItHint, since we've been using theDouglas Gregor2010-03-311-4/+4
| | | | | | | term "fix-it" everywhere and even *I* get tired of long names sometimes. No functionality change. llvm-svn: 100008
* Create a new InjectedClassNameType to represent bare-word references to the John McCall2010-03-101-14/+9
| | | | | | | | | | | | | injected class name of a class template or class template partial specialization. This is a non-canonical type; the canonical type is still a template specialization type. This becomes the TypeForDecl of the pattern declaration, which cleans up some amount of code (and complicates some other parts, but whatever). Fixes PR6326 and probably a few others, primarily by re-establishing a few invariants about TypeLoc sizes. llvm-svn: 98134
OpenPOWER on IntegriCloud