This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++-0X] User-defined literals, gsoc


On 03/29/2011 10:05 AM, Levon Haykazyan wrote:
Hi Ed,

I am working on a proposal to implement user-defined literals as a Google
Summer of Code project. I was unaware that someone was already working on
it. If you have already done some work, maybe it is better for me to pick
another project. Or maybe you would be interested in mentoring me and we
could combine our efforts.

Kind regards,
Levon

----- Original Message -----
From: Ed Smith-Rowland<3dw4rd@verizon.net>
To: gcc@gcc.gnu.org
Subject: [C++-0X] User-defined literals
Date: Mon, 28 Mar 2011 20:13:19 -0400


Greetings,


I am taking a new shot at user-defined literals.
Compared to the previous attempt:
    * I have altered libcpp so that it tokenizes user defined
literals in one chunk properly.
    * I have started work on new tree nodes and accessors.
    * I have (or am trying to) refine the checks for argument and
template parameter.

I would like to check that template literal operators have the
specific non-type parameter pack:
template<char...>
    Foo operator"" sluggo();

I looked through the internals documentation and didn't see much on
this.  Could anyone give me some pointers?

Also, is there any preference for using VEC vs. TREE_CHAIN for
making trees and accessing them?  Is one sort of "modern"?

Finally I am using compparms to verify that a literal operator
argument list conforms to strings like:
(const char*)
(const char*, std::size_t)
(const wchar_t*, std::size_t)
...
I cant get them to work.  I built a set of global trees for the
argument types that I want to check.  The char and number tests
work.
I use things like this to build the argument lists (I neglect the
return type).
      userdef_lit_char16_str_type
       = build_function_type_list (void_type_node, char16_array_type_node,
                   size_type_node, NULL_TREE);
I'm hoping that this matches
(const char16_t*, std::size_t)
but it doesn't.

Ideas?

Thanks,

Ed Smith-Rowland

Levon,

I would be happy to share what I've got. Let me clean it up some and I'll post it tomorrow. Then we'll see if
a. You want to pick another project
b. Pick over what I have and start from there
c. Start over on your own ;-)


There is a good amount of work left to do I think. I have to admit I'm a newbie on gcc internals. You may be in a better position to finish this time-wise.

I am interested in seeing this get in so we can all play with it before the standard comes out. There are some who would pull it out of the standard for want of implementation experience.

Ed


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]