Hi all,
I've finally reworked the generic lambda patches I made back in 2009
(http://gcc.1065356.n5.nabble.com/lambda-Latest-experimental-polymorphic-lambda-patches-tt713016.html)
to apply against GCC's mainline.
The syntaxes demonstrated by the following examples are supported (as
per the previo
---
gcc/cp/mangle.c| 2 ++
gcc/cp/parser.c| 43 +--
gcc/cp/semantics.c | 10 +-
3 files changed, 52 insertions(+), 3 deletions(-)
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 8da62b5..4d4c0fd 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/c
---
gcc/cp/pt.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 3847a1d..fbdd8ec6 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -18847,6 +18847,9 @@ instantiate_decl (tree d, int defer_ok,
tree fn_context;
bool nested;
+ if (TREE_CODE (d) == TEMPLATE
---
gcc/symtab.c | 18 ++
1 file changed, 18 insertions(+)
diff --git a/gcc/symtab.c b/gcc/symtab.c
index 85d47a8..1ada0f7 100644
--- a/gcc/symtab.c
+++ b/gcc/symtab.c
@@ -116,6 +116,15 @@ insert_to_assembler_name_hash (symtab_node node, bool
with_clones)
tree name = DEC
---
gcc/cp/decl.c | 1 +
gcc/cp/parser.c | 203 ++--
gcc/cp/pt.c | 7 ++
3 files changed, 206 insertions(+), 5 deletions(-)
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 047fd77..00bcc35 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.
* diagnostic-core.h: Declare dump_backtrace (void).
* diagnostic.c: Define it.
---
Just realized that I've submitted an unintended hunk in [PATCH 3/4]
(http://gcc.gnu.org/ml/gcc-patches/2013-07/msg00042.html). I didn't
notice that I'd left a tracing line in 'gcc/cp/decl.c'. This
id S::g(A& a, B b)
{
a += b;
}
On Wed, 10 Jul 2013 19:35:24 -0700, Jason Merrill wrote:
> On 07/01/2013 04:26 PM, Adam Butcher wrote:
> > Any comments appreciated. Guidance on implementing the conversion
> > operator for stateless generic lambdas would be useful.
---
gcc/cp/decl2.c | 5 +++--
gcc/cp/lambda.c | 9 -
gcc/cp/parser.c | 36 ++--
gcc/cp/pt.c | 4 +++-
4 files changed, 48 insertions(+), 6 deletions(-)
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 1573ced..c166f6e 100644
--- a/gcc/cp/decl2.c
+
---
gcc/symtab.c | 18 ++
1 file changed, 18 insertions(+)
diff --git a/gcc/symtab.c b/gcc/symtab.c
index 85d47a8..1ada0f7 100644
--- a/gcc/symtab.c
+++ b/gcc/symtab.c
@@ -116,6 +116,15 @@ insert_to_assembler_name_hash (symtab_node node, bool
with_clones)
tree name = DEC
---
gcc/cp/cp-tree.h | 11
gcc/cp/decl.c| 4 +-
gcc/cp/parser.c | 57 ++---
gcc/cp/pt.c | 182 ++-
4 files changed, 231 insertions(+), 23 deletions(-)
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index a837d22.
---
gcc/cp/lambda.c | 77 ++---
1 file changed, 57 insertions(+), 20 deletions(-)
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c
index 98a7925..cf662bb 100644
--- a/gcc/cp/lambda.c
+++ b/gcc/cp/lambda.c
@@ -759,12 +759,9 @@ maybe_add_lambda_conv
---
gcc/cp/cp-tree.h | 2 +-
gcc/cp/decl.c| 3 ++-
gcc/cp/lambda.c | 2 +-
gcc/cp/parser.c | 6 ++
gcc/cp/pt.c | 4 ++--
5 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 64ff4e3..17bb8b9 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/
---
gcc/cp/pt.c | 11 +--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index dea1ec0..6e209f8 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -21317,8 +21317,15 @@ add_implicit_template_parms (size_t count, tree
parameters)
// Rewrite the
rt the examples given in N3690 ยง5.1.2.{5,6} and
the test program included at the end of this mail. I think it is
feature-complete.
On 19.07.2013 17:56, Jason Merrill wrote:
> On 07/19/2013 05:00 AM, Adam Butcher wrote:
> >
> > + push_deferring_access_checks (dk_deferred);
> &g
---
gcc/cp/pt.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index a7baaba..99bc71b 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -1986,7 +1986,7 @@ determine_specialization (tree template_id,
tree decl_arg_types;
/* This
On 03.08.2013 14:39, Gabriel Dos Reis wrote:
On Thu, Aug 1, 2013 at 7:25 AM, Adam Butcher
wrote:
---
gcc/cp/cp-tree.h | 2 +-
gcc/cp/decl.c| 3 ++-
gcc/cp/lambda.c | 2 +-
gcc/cp/parser.c | 6 ++
gcc/cp/pt.c | 4 ++--
5 files changed, 8 insertions(+), 9 deletions(-)
When
On 03.08.2013 14:35, Gabriel Dos Reis wrote:
On Thu, Aug 1, 2013 at 7:25 AM, Adam Butcher
wrote:
---
gcc/cp/pt.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index a7baaba..99bc71b 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -1986,7
Hi Paolo,
On 03.08.2013 19:38, Paolo Carlini wrote:
.. I don't know if at this Stage we are paying attention to these
minor details, but at least Patch 1 and 3 appear to have some
overlong
lines.
The patch set referenced by your mail has been superseded (see [1] and
[2]). I think most of th
Hi Jason,
On 03.08.2013 17:18, Jason Merrill wrote:
On 08/01/2013 08:25 AM, Adam Butcher wrote:
+= DECL_TEMPLATE_INFO (callop)
+&& DECL_TEMPLATE_RESULT (DECL_TI_TEMPLATE (callop)) == callop;
An expression broken across lines should be parenthesized.
And let's move th
Hi Jason,
On Mon, 05 Aug 2013 17:26:12 -0400, Jason Merrill wrote:
> On 08/04/2013 07:45 PM, Adam Butcher wrote:
> > What should I do about the symtab nullptr issue?
> > (http://gcc.gnu.org/ml/gcc-patches/2013-07/msg00043.html) Should I
> > leave the workaround in my patc
On 07.08.2013 16:59, Jason Merrill wrote:
On 08/07/2013 03:52 AM, Adam Butcher wrote:
But a cleaner way might be to extend the "processing
template declaration" state from lambda declarator all the way to
the end of the
lambda body. This would match with the scenario that occ
On 07.08.2013 20:56, Adam Butcher wrote:
On 07.08.2013 16:59, Jason Merrill wrote:
On 08/07/2013 03:52 AM, Adam Butcher wrote:
But a cleaner way might be to extend the "processing
template declaration" state from lambda declarator all the way to
the end of the
lambda body. This w
On 09.08.2013 03:01, Jason Merrill wrote:
On 08/08/2013 06:28 PM, Adam Butcher wrote:
So all seems to be okay with both versions. Any ideas why?
Hmm, it sounds like processing_template_decl is being set after all,
even without your change.
Yup. Although the lambda template code I
Hi Jason,
I decided to go ahead and submit the latest cleaned up version of the generic
lambda and implicit function template patches. I think all review comments have
been addressed. As well as the cleanup there are a few enhancements; generic
lambda instantiations in diagnostics now show templ
* cp-tree.h (struct saved_scope): Add x_fully_implicit_template bit ...
(fully_implicit_template): ... and provide conventional access to it.
(type_uses_auto_or_concept): Declare.
(is_auto_or_concept): Declare.
(add_implicit_template_parms): Declare.
* parser.c (cp_parser_lambda_declarator_opt): Accept template parameter
list with std=gnu++1y.
(cp_parser_lambda_body): Don't call 'expand_or_defer_fn' for lambda call
operator template to avoid adding template result to symbol table.
* lambda.c (lambda_funct
* error.c (dump_function_decl): Use standard diagnostic flow to dump a
lambda diagnostic, albeit without stating the function name or
duplicating the parameter spec (which is dumped as part of the type).
---
gcc/cp/error.c | 22 +++---
1 file changed, 11 ins
* pt.c: Grammar fix in comments ("it's" to "its").
---
gcc/cp/pt.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index ce899ef..78b7a97 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -1986,7 +1986,7 @@ determine_specialization (tree tem
On 12.08.2013 16:33, Jason Merrill wrote:
On 08/12/2013 09:06 AM, Dodji Seketeli wrote:
FWIW, this change seems to fall under the obvious rule and thus,
ought
to be committed.
Agreed. But I don't see Adam's name in MAINTAINERS; do you still
need to get set up for write after approval?
Yes,
On 12.08.2013 22:03, Jason Merrill wrote:
On 08/12/2013 04:52 PM, Adam Butcher wrote:
Yes, I must confess up until now I hadn't considered it. I've just
been
submitting patches from a clone of http://gcc.gnu.org/git/gcc.git.
Are
you happy to approve this?
Yes.
Cheers. Submitte
+1,7 @@
+2013-08-13 Adam Butcher
+
+ * MAINTAINERS (Write After Approval): Add myself.
+
2013-08-12 Caroline Tice
* MAINTAINERS: Add myself as libvtv maintainer. Correct my email
diff --git a/MAINTAINERS b/MAINTAINERS
index ad418b1..ef6ab87 100644
--- a/MAINTAINERS
+++ b
100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,7 @@
+2013-08-13 Adam Butcher
+
+ * pt.c: Grammar fix in comments ("it's" to "its").
+
2013-08-12 Paolo Carlini
* decl.c (warn_extern_redeclared_static, duplicate_decls,
diff --git a/gcc/cp
On 12.08.2013 16:47, Jason Merrill wrote:
On 08/11/2013 03:49 PM, Adam Butcher wrote:
+ if (cxx_dialect < cxx1y || flag_iso)
+ cp_parser_error (parser,
+"lambda templates are only available with "
+"-std=gnu++1y&quo
On 12.08.2013 17:00, Jason Merrill wrote:
On 08/11/2013 03:49 PM, Adam Butcher wrote:
+#define fully_implicit_template
scope_chain->x_fully_implicit_template
Why did you choose to add this to saved_scope rather than cp_parser?
It seems like state that could be local to the parser rather t
Hi,
The following patch adds details of support for generic functions and
the explicit template parameter extension for generic lambdas present in
GCC 4.9.
OK to commit?
Cheers,
Adam
Index: htdocs/gcc-4.9/changes.html
===
RCS f
PR c++/60190
* parser.c (cp_parser_lambda_declarator_opt): Pop template parameter
scope whenever a template parameter list has been started, independent
of whether the function call operator was well-formed or not.
PR c++/60190
* g++.dg/cpp1y/pr60190
PR c++/60064
* parser.c (cp_parser_member_declaration): Pop fully implicit template
scope for generic friend declarations as well as for non-friends.
PR c++/60064
* g++.dg/cpp1y/pr60064.C: New testcase.
---
gcc/cp/parser.c | 8 +++-
gcc/testsuite/g++.
PR c++/60052
* parser.c (cp_parser_parameter_declaration_list): Correctly reset
implicit_template_scope upon leaving an out-of-line generic member
function definition.
PR c++/60052
* g++.dg/cpp1y/pr60052.C: New testcase.
---
gcc/cp/parser.c
On 2014-02-20 1:24, Adam Butcher wrote:
PR c++/60052
* parser.c (cp_parser_parameter_declaration_list): Correctly reset
implicit_template_scope upon leaving an out-of-line generic member
function definition.
Turns out this fixes 60053 too.
PR c++/60065
* parser.c (cp_parser_parameter_declaration_list): Use
current_template_parms and scope check as predicate for
inspecting current function template parameter list length
rather than num_template_parameter_lists.
PR c++/60065
* g+
On 2014-02-20 16:18, Jason Merrill wrote:
On 02/19/2014 10:00 PM, Adam Butcher wrote:
+ if (current_template_parms)
+{
+ cp_binding_level *maybe_tmpl_scope =
current_binding_level->level_chain;
+ while (maybe_tmpl_scope && maybe_tmpl_scope->kin
On 2014-02-21 15:49, Jason Merrill wrote:
On 02/21/2014 03:19 AM, Adam Butcher wrote:
Jason Merrill wrote:
Why doesn't num_template_parameter_lists work as a predicate here?
It works in the lambda case as it is updated there, but for generic
functions I think the following preven
PR c++/60065
* parser.c (cp_parser_direct_declarator): Don't save and
restore num_template_parameter_lists around call to
cp_parser_parameter_declaration_list.
(function_being_declared_is_template_p): New predicate.
(cp_parser_parameter_declaration_li
* parser.c (synthesize_implicit_template_parm): Inject new template
argument list appropriately when a generic member function
of a class template is declared out-of-line.
* g++.dg/cpp1y/fn-generic-member-ool.C: New testcase.
---
gcc/cp/parser.c
On 2014-02-24 18:16, Jason Merrill wrote:
On 02/24/2014 02:32 AM, Adam Butcher wrote:
+static bool function_being_declared_is_template_p (cp_parser*
parser)
Function name should be at the beginning of the next line.
Doh! Fixed.
- if (scope->kind != sk_template_parms)
+
PR c++/60311
* parser.c (function_being_declared_is_template_p): Return false when
processing a template parameter list.
(cp_parser_parameter_declaration_clause): Don't set
auto_is_implicit_function_template_parm_p when processing a
template parameter
PR c++/60377
* parser.c (cp_parser_parameter_declaration_clause): Unwind generic
function scope on parse error in function parameter list.
PR c++/60377
* g++.dg/cpp1y/pr60377.C: New testcase.
---
gcc/cp/parser.c | 7 ++-
gcc/testsui
On 2014-07-26 17:14, Jason Merrill wrote:
On 07/26/2014 12:11 PM, Jason Merrill wrote:
On 07/26/2014 03:04 AM, Braden Obrzut wrote:
On 07/25/2014 05:24 PM, Jason Merrill wrote:
Fair enough, but in that case let's use 'sorry' rather then
'error' to
be clear that it's a missing feature.
Tes
On 2014-07-27 19:01, Andrew Sutton wrote:
In the 59638 case, the declarations
void (*a)(auto);
void (*b)(auto) = 0;
are shorthand for
template void (*a)(T);
template void (*b)(T) = 0;
which, unless there's some constraint with variable templates that
I'm not
aware of, ought to def
On 2014-07-28 3:06, Braden Obrzut wrote:
So given this, should I leave the test cases that fail for this
reason alone or should I still change them to dg-message?
I'm not sure what GCC's policy is here, Jason will.
It sounds like GCC's behavior with auto in function parameters
needs to be cha
On 2014-07-28 13:09, Andrew Sutton wrote:
3) auto (*f (auto)) (auto); // generic function 'f' constrained to
returning a unary function pointer deduced from the return
expression.
Really? I've read the comment and I'm still not sure how to read this
declaration.
The first and last 'auto' in
PR c++/60033
* pt.c (retrieve_specialization): When retrieving a capture pack from a
generic lambda, remove the lambda's own template argument list prior to
fetching the specialization.
PR c++/60033
* g++.dg/cpp1y/pr60033.C: New testcase.
---
gcc/cp
PR c++/60393
* parser.c (cp_parser_parameter_declaration_clause): Move generic
function template unwinding on error into a move general location, ...
(cp_parser_error): ... here.
PR c++/60393
* g++.dg/cpp1y/pr60393.C: New testcase.
---
gcc/cp/parser
On 2014-03-07 17:29, Jason Merrill wrote:
On 03/04/2014 04:46 PM, Adam Butcher wrote:
PR c++/60393
* parser.c (cp_parser_parameter_declaration_clause): Move generic
function template unwinding on error into a move general location,
...
(cp_parser_error): ... here
PR c++/60033
* pt.c (tsubst_copy): When retrieving a capture pack from a generic
lambda, remove the lambda's own template argument list prior to fetching
the specialization.
PR c++/60033
* g++.dg/cpp1y/pr60033.C: New testcase.
---
gcc/cp/pt.c
PR c++/60393
* parser.c (cp_parser_parameter_declaration_clause): Move generic
function template unwinding on error into a more general location, ...
(cp_parser_skip_to_end_of_statement): ... here.
PR c++/60393
* g++.dg/cpp1y/pr60393.C: New testcase.
PR c++/60391
* parser.c (cp_parser_skip_to_end_of_block_or_statement): Unwind generic
function scope as per cp_parser_skip_to_end_of_statement.
PR c++/60391
* g++.dg/cpp1y/pr60391.C: New testcase.
---
gcc/cp/parser.c | 4
gcc/tests
PR c++/60390
* parser.c (cp_parser_member_declaration): Don't allow
finish_fully_implicit_template to consider friend declarations to be
class member templates.
(synthesize_implicit_template_parm): Handling winding back through class
scope to the clas
PR c++/60573
* parser.c (synthesize_implicit_template_parm): Handle the fact that
nested class member declarations erroneously appearing in an enclosing
class contain an addition scope level for the class being defined.
PR c++/60573
* g++.dg/cpp1y/pr
PR c++/60627
* parser.c (cp_parser_parameter_declaration_clause): Prevent 'auto' from
introducing an implicit function template parameter within an explicit
instantiation.
PR c++/60627
* g++.dg/cpp1y/pr60627.C: New testcase.
---
gcc/cp/parser.c
On 2014-03-24 17:23, Jason Merrill wrote:
On 03/18/2014 10:46 PM, Adam Butcher wrote:
- while (scope->kind == sk_class
-&& !TYPE_BEING_DEFINED (scope->this_entity))
Does it work to just change TYPE_BEING_DEFINED to
currently_open_class?
No. The obje
PR c++/60626
* parser.c (cp_parser_init_declarator): Handle erroneous generic type
usage in non-functions with pushed scope.
PR c++/60626
* g++.dg/cpp1y/pr60626.C: New testcase.
---
gcc/cp/parser.c | 9 -
gcc/testsuite/g++.dg/cp
* parser.c (cp_parser_simple_type_specifier): Lookahead for a braced
identifier after a generic type ('auto') parameter and, if present, use
that as the type identifier name. Otherwise generate one with
make_generic_type_name. Pass the resulting identifier as the n
On 2014-03-25 15:48, Jason Merrill wrote:
On 03/18/2014 10:46 PM, Adam Butcher wrote:
+ if (TYPE_BEING_DEFINED (scope->this_entity))
+ if (scope->level_chain == 0
+ || scope->this_entity != scope->level_chain->this_entity)
+
On 2014-03-26 15:17, Jason Merrill wrote:
I meant
struct A
{
struct X
{
struct B
{
void foo(auto);
};
void B::foo(auto) {} // { dg-error "cannot define" }
};
};
Here we push both A and X for the declarator. When we get to the
pushed X, we se
On 2014-03-25 15:48, Jason Merrill wrote:
I think we need some way to designate a scope that actually
corresponds to a class-specifier.
Agreed. I'll look into it.
Adam
PR c++/60573
* parser.c (synthesize_implicit_template_parm): Use cp_binding_level::
class_shadowed rather than TYPE_BEING_DEFINED as the predicate for
unwinding to class-defining scope to handle the erroneous definition of
a generic function of an arbitrarily
PR c++/60573
* name-lookup.h (cp_binding_level): New field scope_defines_class_p.
* semantics.c (begin_class_definition): Set scope_defines_class_p.
* pt.c (instantiate_class_template_1): Likewise.
* parser.c (synthesize_implicit_template_parm): Use cp_bindin
On 2014-03-27 20:45, Adam Butcher wrote:
@@ -8905,9 +8905,12 @@ instantiate_class_template_1 (tree type)
return type;
/* Now we're really doing the instantiation. Mark the type as in
- the process of being defined. */
+ the process of being defined... */
TYPE_BEING_DE
On 2014-03-27 20:45, Adam Butcher wrote:
PR c++/60573
* name-lookup.h (cp_binding_level): New field scope_defines_class_p.
* semantics.c (begin_class_definition): Set scope_defines_class_p.
* pt.c (instantiate_class_template_1): Likewise.
* parser.c
On 2014-03-27 21:16, Adam Butcher wrote:
On 2014-03-27 20:45, Adam Butcher wrote:
PR c++/60573
* name-lookup.h (cp_binding_level): New field scope_defines_class_p.
* semantics.c (begin_class_definition): Set scope_defines_class_p.
* pt.c (instantiate_class_template_1): Likewise.
* parser.c
PR c++/60573
* name-lookup.h (cp_binding_level): New transient field defining_class_p
to indicate whether a scope is in the process of defining a class.
* semantics.c (begin_class_definition): Set defining_class_p.
* name-lookup.c (leave_scope): Reset definin
On Tue, March 15, 2011 1:59 pm, Jason Merrill wrote:
> Now that we're in stage 1 of 4.7, I'm looking to apply this soon, but
> now I notice that it doesn't have a testcase. Could you add one?
>
Sorry I didn't see this earlier. Been busy with day-job stuff for
months and let my mail account overru
t see either of your responses (or the committed
fix) on this decltype stuff until now.
> On 01/20/2011 11:51 AM, Adam Butcher wrote:
>>
>> Although this seems to work for many scenarios, the resulting tree
>> seems to be treated as dependent (in the sense of dependent
On Fri, July 22, 2011 10:23 pm, Jason Merrill wrote:
> On 07/21/2011 11:48 AM, Adam Butcher wrote:
>> No worries. I'm guilty of not checking mails for months due to other
>> commitments so didn't see either of your responses (or the committed
>> fix) on this decl
Hi,
I found that with the latest GCC 4.6.0 release candidate, dynamically
linking against libstdc++ fails for client code that expects to move an
object derived from std::string. The move constructor (either
explicitly specified or compiler generated) of such a class fails to
link in the std::str
On Tue, March 22, 2011 1:39 pm, Jakub Jelinek wrote:
> On Tue, Mar 22, 2011 at 01:10:14PM -0000, Adam Butcher wrote:
>> After a bit of poking around with nm in various objects I determined
>> that the baseline_symbols files define what should be exported. The
>> following gr
101 - 177 of 177 matches
Mail list logo