[C++0x]User-defined literals - building a call to template function.

2011-05-04 Thread Ed Smith-Rowland
Greetings, I am working on user-defined literals and have much of it working. I am stuck on template function calls though. If I have a literal oprator like this: template int operator"" _abc() { return 42 + sizeof...(Chars); } Then later on I see this: int j = 123_abc; I need to look

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

2011-03-30 Thread Jason Merrill
On 03/28/2011 08:13 PM, Ed Smith-Rowland wrote: Please CC me on C++ questions, as I don't keep up with the mailing list very well. I would like to check that template literal operators have the specific non-type parameter pack: template Foo operator"" sluggo(); I looked through the internals

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

2011-03-29 Thread Levon Haykazyan
> - Original Message - > From: Ed Smith-Rowland <3dw...@verizon.net> > To: gcc@gcc.gnu.org > Subject: Re: [C++-0X] User-defined literals, gsoc > Date: Tue, 29 Mar 2011 10:16:52 -0400 > > > On 03/29/2011 10:05 AM, Levon Haykazyan wrote: > > Hi Ed, &

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

2011-03-29 Thread James Dennett
gt;> - Original Message ----- >>> From: Ed Smith-Rowland<3dw...@verizon.net> >>> To: gcc@gcc.gnu.org >>> Subject: [C++-0X] User-defined literals >>> Date: Mon, 28 Mar 2011 20:13:19 -0400 >>> >>> >>> Greetings, >>>

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

2011-03-29 Thread Ed Smith-Rowland
maybe you would be interested in mentoring me and we could combine our efforts. Kind regards, Levon - Original Message - From: Ed Smith-Rowland<3dw...@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

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

2011-03-29 Thread Levon Haykazyan
and we could combine our efforts. Kind regards, Levon > - Original Message - > From: Ed Smith-Rowland <3dw...@verizon.net> > To: gcc@gcc.gnu.org > Subject: [C++-0X] User-defined literals > Date: Mon, 28 Mar 2011 20:13:19 -0400 > > > Greetings, > > I

[C++-0X] User-defined literals

2011-03-28 Thread Ed Smith-Rowland
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 a

Re: [C++-0x] User-defined literals.

2010-10-04 Thread Jason Merrill
On 10/04/2010 02:16 PM, 3dw...@verizon.net wrote: You shouldn't be able to call it as just _foo(1.2L); an operator name is different from a normal function name. According to 13.5.8/7 : [ Note: literal operators and literal operator templates are usually invoked implicitly through user-defi

Re: Re: [C++-0x] User-defined literals.

2010-10-04 Thread 3dw4rd
Oct 4, 2010 11:26:15 AM, ja...@redhat.com wrote: >On 09/17/2010 02:25 AM, Ed Smith-Rowland wrote: >> I am slowly working on user defined literals for C++-0x. > >Thanks! Please send future patches to gcc-patches and me directly. > >Looking over your patch, I see you're doing a significant amount o

Re: [C++-0x] User-defined literals.

2010-10-04 Thread Jason Merrill
On 09/17/2010 02:25 AM, Ed Smith-Rowland wrote: I am slowly working on user defined literals for C++-0x. Thanks! Please send future patches to gcc-patches and me directly. Looking over your patch, I see you're doing a significant amount of it in the parser, which is incorrect; the draft says

Re: [C++-0x] User-defined literals.

2010-09-21 Thread Ed Smith-Rowland
This is to get a paper trail started. TODO: Find out if/what LTO issues there may be with user-defined literals. Ed

Re: [C++-0x] User-defined literals.

2010-09-21 Thread Ed Smith-Rowland
On 09/21/2010 06:47 PM, Rodrigo Rivas wrote: I'm holding out for rolling back the lexer in some way that won't break everything and emitting the (unrecognized by cpp ) suffix as a separate identifier token. I'm thinking the cp_lexer_* routines or maybe a new one in parser.c would be worth try

Re: Re: [C++-0x] User-defined literals.

2010-09-21 Thread Rodrigo Rivas
> I'm holding out for rolling back the lexer in some way that won't break > everything and emitting the (unrecognized by cpp ) suffix as a separate > identifier token.  I'm thinking the cp_lexer_* routines or maybe a new one in > parser.c would be worth trying.  Then the code I have now would ju

Re: Re: [C++-0x] User-defined literals.

2010-09-21 Thread 3dw4rd
Sep 21, 2010 03:56:25 PM, rodrigorivasco...@gmail.com wrote: >> 3. The big one: Getting the integer(long long) and float(long double) >> suffixes that are not used by gcc out of the preprocessor. Then we >can >> build the calls. > >Just my two cents: >Add an output parameter to the function "

Re: [C++-0x] User-defined literals.

2010-09-21 Thread Rodrigo Rivas
> 3. The big one: Getting the integer(long long) and float(long double) > suffixes that are not used by gcc out of the preprocessor.  Then we can > build the calls. Just my two cents: Add an output parameter to the function "cpp_classify_number()" (libcpp/expr.c) to get the user-defined suffix. It

Re: [C++-0x] User-defined literals.

2010-09-20 Thread Rodrigo Rivas
> I'm looking at (besides input on what I've got currently): So far I see it fine... except: int len = TREE_STRING_LENGTH (strl); should be: int len = TREE_STRING_LENGTH (strl) - 1; since the draft says "its length excluding the terminating null character". Also, I had to c

Re: [C++-0x] User-defined literals.

2010-09-19 Thread Ed Smith-Rowland
On 09/19/2010 02:37 PM, Rodrigo Rivas wrote: Maybe Rodrigo would be interested in collaborating on this work? Sure I am! Please, let me a couple of days to re-read the C++ draft, and check this patch. Also, take in account that I'm in no way a GCC expert... but I'll do my best. Also I hav

Re: [C++-0x] User-defined literals.

2010-09-19 Thread Rodrigo Rivas
> Maybe Rodrigo would be interested in collaborating on this work? Sure I am! Please, let me a couple of days to re-read the C++ draft, and check this patch. Also, take in account that I'm in no way a GCC expert... but I'll do my best. Also I have a little patch on my own that might use some help.

Re: [C++-0x] User-defined literals.

2010-09-19 Thread Paolo Carlini
On 09/17/2010 08:25 AM, Ed Smith-Rowland wrote: > Thanks for any help you can give, Maybe Rodrigo would be interested in collaborating on this work? Rodrigo? Thanks, Paolo.

[C++-0x] User-defined literals.

2010-09-16 Thread Ed Smith-Rowland
Greetings, I am slowly working on user defined literals for C++-0x. This is my first foray into the C++ front end and I'm stuck. Anyway, I managed to parse things like long double operator"" _foo(long double x) { return 2.0L * x; } The result is a normal function that I can either call li