summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/temp
Commit message (Collapse)AuthorAgeFilesLines
...
* Make sure that we don't visit redeclarations of nested classes whileDouglas Gregor2010-04-181-0/+17
| | | | | | | | instantiating class members as part of an explicit instantiation. Addresses a compilation problem in Boost.Serialization. llvm-svn: 101725
* Audit uses of Sema::LookupSingleName for those lookups that areDouglas Gregor2010-04-151-0/+12
| | | | | | | | | | | intended for redeclarations, fixing those that need it. Fixes PR6831. This uncovered an issue where the C++ type-specifier-seq parsing logic would try to perform name lookup on an identifier after it already had a type-specifier, which could also lead to spurious ambiguity errors (as in PR6831, but with a different test case). llvm-svn: 101419
* Parse friend template ids as types instead of ending up inJohn McCall2010-04-141-0/+17
| | | | | | | ActOnClassTemplateSpecialization and being very confused. Fixes PR6514 (for non-templated-scope friends). llvm-svn: 101198
* Fix an embarrasing memory error. I was apparently very tired when I wrote thisJohn McCall2010-04-131-0/+25
| | | | | | | | code the first time. Fixes PR6827. llvm-svn: 101184
* Implement C++ [temp.local]p4, which specifies how we eliminateDouglas Gregor2010-04-121-0/+32
| | | | | | | | | name-lookup ambiguities when there are multiple base classes that are all specializations of the same class template. This is part of a general cleanup for ambiguities in template-name lookup. Fixes PR6717. llvm-svn: 101065
* Fix a crash-on-invalid involving name lookup of tag names, where weDouglas Gregor2010-04-121-3/+3
| | | | | | | ended up finding a function template that we didn't expect. Recover more gracefully, and fix a similar issue for class templates. llvm-svn: 101040
* Only complain about explicit instantiations following explicitDouglas Gregor2010-04-091-11/+11
| | | | | | | | | | | | specializations when the explicit instantiation was... explicitly written, i.e., not the product of an explicit instantiation of an enclosing class. Fixes this spurious warning when Clang builds LLVM: /Volumes/Data/dgregor/Projects/llvm/lib/CodeGen/MachineDominators.cpp:22:1: warning: explicit instantiation of 'addRoot' that occurs after an explicit specialization will be ignored (C++0x extension) [-pedantic] llvm-svn: 100900
* Turn access control on by default in -cc1.John McCall2010-04-093-5/+5
| | | | | | | | Remove -faccess-control from -cc1; add -fno-access-control. Make the driver pass -fno-access-control by default. Update a bunch of tests to be correct under access control. llvm-svn: 100880
* Instantiate default argument expressions even if their associated parameterJohn McCall2010-04-091-0/+15
| | | | | | type isn't dependent. Fixes rdar://problem/7838962. llvm-svn: 100871
* Set access properly on instantiated friend class template declarations.John McCall2010-04-081-0/+13
| | | | | | Fixes PR6752. llvm-svn: 100806
* Make CXXScopeSpec invalid when incomplete, and propagate that into anyJeffrey Yasskin2010-04-081-9/+7
| | | | | | | Declarator that depends on it. This fixes several redundant errors and bad recoveries. llvm-svn: 100779
* Implement dependent friend function template specializations.John McCall2010-04-081-0/+22
| | | | llvm-svn: 100753
* Improve handling of friend types in several ways:Douglas Gregor2010-04-071-2/+1
| | | | | | | | | | | - When instantiating a friend type template, perform semantic analysis on the resulting type. - Downgrade the errors concerning friend type declarations that do not refer to classes to ExtWarns in C++98/03. C++0x allows practically any type to be befriended, and ignores the friend declaration if the type is not a class. llvm-svn: 100635
* Overhaul checking of non-type template arguments that should refer toDouglas Gregor2010-04-013-6/+81
| | | | | | | | | | | an object or function. Our previous checking was too lax, and ended up allowing missing or extraneous address-of operators, among other evils. The new checking provides better diagnostics and adheres more closely to the standard. Fixes PR6563 and PR6749. llvm-svn: 100125
* After performing template argument deduction for a function template,Douglas Gregor2010-03-281-0/+31
| | | | | | | | | | | | | | | | | | | | check deduced non-type template arguments and template template arguments against the template parameters for which they were deduced, performing conversions as appropriate so that deduced template arguments get the same treatment as explicitly-specified template arguments. This is the bulk of PR6723. Also keep track of whether deduction of a non-type template argument came from an array bound (vs. anywhere else). With this information, we enforce C++ [temp.deduct.type]p17, which requires exact type matches when deduction deduces a non-type template argument from something that is not an array bound. Finally, when in a SFINAE context, translate the "zero sized arrays are an extension" extension diagnostic into a hard error (for better standard conformance), which was a minor part of PR6723. llvm-svn: 99734
* Implement method friends in class templates and fix a few related problems.John McCall2010-03-271-0/+25
| | | | llvm-svn: 99708
* Add tests for PR6707.Douglas Gregor2010-03-261-0/+20
| | | | llvm-svn: 99613
* Reapply r99596 with a fix: link an instantiated friend function to itsJohn McCall2010-03-261-0/+13
| | | | | | pattern if it has a body. llvm-svn: 99610
* Apparently that didn't work. Reverting for now.John McCall2010-03-261-13/+0
| | | | llvm-svn: 99601
* Reinstate change to non-type template arguments of integral type, soDouglas Gregor2010-03-261-0/+6
| | | | | | | | | that we extend/truncate then correct the sign to convert the non-type template argument to the template parameter's type. Previously, we reported an error when the non-type template argument was out of range; now we just warn. llvm-svn: 99600
* Properly instantiate and link in friend function templates.John McCall2010-03-261-0/+13
| | | | llvm-svn: 99596
* Revert attempted fix for integral template arguments. It seems to have ↵Douglas Gregor2010-03-261-6/+0
| | | | | | broken tramp3d-v4. llvm-svn: 99583
* Warn when the conversion of an integral non-type template argument toDouglas Gregor2010-03-251-0/+6
| | | | | | | | | | | | | | | | | | the type of its corresponding non-type template parameter changes the value. Previously, we were diagnosing this as an error, which was wrong. We give reasonably nice warnings like: test/SemaTemplate/temp_arg_nontype.cpp:100:10: warning: non-type template argument value '256' truncated to '0' for template parameter of type 'unsigned char' Overflow<256> *overflow3; // expected-warning{{non-type template ... ^~~ test/SemaTemplate/temp_arg_nontype.cpp:96:24: note: template parameter is declared here template<unsigned char C> struct Overflow; ^ llvm-svn: 99561
* Handle simple friend-class decls in class templates better by ensuring thatJohn McCall2010-03-251-0/+28
| | | | | | | we look for shadow friend decls in the appropriate scope before injecting a new declaration. llvm-svn: 99552
* Properly instantiate friend class template declarations and link them intoJohn McCall2010-03-251-0/+23
| | | | | | | the redeclaration chain. Recommitted from r99477 with a fix: we need to merge in default template arguments from previous declarations. llvm-svn: 99496
* Revert 99477 since it appears to be breaking the clang-x86_64-darwin10-fntBob Wilson2010-03-251-14/+0
| | | | | | | | | | | buildbot. The tramp3d test fails. --- Reverse-merging r99477 into '.': U test/SemaTemplate/friend-template.cpp U test/CXX/temp/temp.decls/temp.friend/p1.cpp U lib/Sema/SemaTemplateInstantiateDecl.cpp U lib/Sema/SemaAccess.cpp llvm-svn: 99481
* Properly instantiate and link in friend-class-template declarations.John McCall2010-03-251-0/+14
| | | | llvm-svn: 99477
* Silently drop dependent friend function template specializations,Douglas Gregor2010-03-241-1/+11
| | | | | | | | since we have absolutely no way to match them when they are declared nor do we have a way to represent these parsed-but-not-checked friend declarations. llvm-svn: 99407
* Support friend function specializations.John McCall2010-03-242-4/+4
| | | | llvm-svn: 99389
* Implement a framework for the delay of arbitrary diagnostics withinJohn McCall2010-03-241-0/+32
| | | | | | | | | templates. So delay access-control diagnostics when (for example) the target of a friend declaration is a specific specialization of a template. I was surprised to find that this was required for an access-controlled selfhost. llvm-svn: 99383
* Implement non-dependent friend functions and classes.John McCall2010-03-171-1/+32
| | | | llvm-svn: 98764
* During C++ name lookup, use DeclContext::Equals() rather thanDouglas Gregor2010-03-151-0/+19
| | | | | | | comparing DeclContext pointers, to avoid having to remember to call getPrimaryContext() everywhere. This is the last part PR6594. llvm-svn: 98546
* Implement C++ [temp.local]p8, which specifies that a templateDouglas Gregor2010-03-153-0/+59
| | | | | | | | | | | parameter hides a namespace-scope declararion with the same name in an out-of-line definition of a template. The lookup requires a strange interleaving of lexical and semantic scopes (go C++), which I have not yet handled in the typo correction/code completion path. Fixes PR6594. llvm-svn: 98544
* Give explicit template instantiations weak ODR linkage. FormerDouglas Gregor2010-03-131-2/+2
| | | | | | | | | iterations of this patch gave explicit template instantiation link-once ODR linkage, which permitted the back end to eliminate unused symbols. Weak ODR linkage still requires the symbols to be generated. llvm-svn: 98441
* Re-revert the explicit template instantiation linkage patch. I am beginning ↵Douglas Gregor2010-03-131-2/+2
| | | | | | to look incompetent llvm-svn: 98425
* Reinstate patch to turn explicit template instantiations into weak symbolsDouglas Gregor2010-03-131-2/+2
| | | | llvm-svn: 98424
* Revert the linkage change for explicit template instantiations; something is ↵Douglas Gregor2010-03-121-2/+2
| | | | | | amiss llvm-svn: 98332
* Give explicit template instantiations weak linkage (but don't deferDouglas Gregor2010-03-121-2/+2
| | | | | | them). Fixes PR6578. llvm-svn: 98328
* Suppress implicit member redeclarations arising from explicit instantiationJohn McCall2010-03-021-0/+16
| | | | | | | | | | | | declarations after the member has been explicitly specialized. We already did this after explicit instantiation definitions; not doing it for declarations meant that subsequent definitions would see a previous member declaration with specialization kind "explicit instantiation decl", which would then happily get overridden. Fixes PR 6458. llvm-svn: 97605
* When we're parsing template names as part of base-specifiers, we areDouglas Gregor2010-03-011-0/+19
| | | | | | | | *not* entering the context of the nested-name-specifier. This was causing us to look into an uninstantiated template that we shouldn't look into. Fixes PR6376. llvm-svn: 97524
* Warn about the deprecated string literal -> char* conversion. Fixes PR6428.Douglas Gregor2010-02-281-2/+3
| | | | llvm-svn: 97404
* 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
* An explicit specialization is allowed following an explicitDouglas Gregor2010-02-261-0/+7
| | | | | | | instantiation so long as that explicit specialization was declared previously. Fixes PR6160. llvm-svn: 97210
* Do not require a complete type when checking for a pointer conversionDouglas Gregor2010-02-221-0/+21
| | | | | | between cv1 T* and cv2 T*. llvm-svn: 96787
* Permit the use of typedefs of class template specializations inDouglas Gregor2010-02-131-2/+13
| | | | | | | qualified declarator-ids. This patch is actually due to Cornelius; fixes PR6179. llvm-svn: 96082
* Migrate the mish-mash of declaration checks inDouglas Gregor2010-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Sema::ActOnUninitializedDecl over to InitializationSequence (with default initialization), eliminating redundancy. More importantly, we now check that a const definition in C++ has an initilizer, which was an #if 0'd code for many, many months. A few other tweaks were needed to get everything working again: - Fix all of the places in the testsuite where we defined const objects without initializers (now that we diagnose this issue) - Teach instantiation of static data members to find the previous declaration, so that we build proper redeclaration chains. Previously, we had the redeclaration chain but built it too late to be useful, because... - Teach instantiation of static data member definitions not to try to check an initializer if a previous declaration already had an initializer. This makes sure that we don't complain about static const data members with in-class initializers and out-of-line definitions. - Move all of the incomplete-type checking logic out of Sema::FinalizeDeclaratorGroup; it makes more sense in ActOnUnitializedDecl. There may still be a few places where we can improve these diagnostics. I'll address that as a separate commit. llvm-svn: 95657
* When substituting a declaration non-type template argument for aDouglas Gregor2010-02-081-0/+16
| | | | | | | | non-type template parameter that has reference type, augment the qualifiers of the non-type template argument with those of the referenced type. Fixes PR6250. llvm-svn: 95607
* Add a test case for r95555.Sebastian Redl2010-02-081-0/+15
| | | | llvm-svn: 95562
* Fix a bogus assertion after adjusting the type of a substitutedDouglas Gregor2010-02-051-0/+6
| | | | | | | non-type template argument for a non-type template parameter of pointer type. Fixes PR6244. llvm-svn: 95447
* When substituting the template argument for a pointer non-typeDouglas Gregor2010-02-041-0/+37
| | | | | | | | | template parameter, perform array/function decay (if needed), take the address of the argument (if needed), perform qualification conversions (if needed), and remove any top-level cv-qualifiers from the resulting expression. Fixes PR6226. llvm-svn: 95309
OpenPOWER on IntegriCloud