This is the mail archive of the gcc-patches@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++-11] User defined literals


On 10/15/2011 04:42 PM, Jason Merrill wrote:
On 10/12/2011 04:58 PM, 3dw4rd@verizon.net wrote:
+ tree const_char_ptr_type_node
+ = build_pointer_type (build_type_variant (char_type_node, 1, 0));

You can just use const_string_type_node here.


Jason

I made this change.

I also added a test case to make sure that embedded quotes are not a problem.
No valid string can begin or end with an escaped quote. So the string delimiter is found by loking for the first quote in the string.
The suffix is found by looking for that same quote from the end of the string.


While looking at the embedded string issue I found that if you apply the suffix of a raw literal to a string it errors as it should but the error complained that there were too many arguments for the function. This was not helpful so I made a nicer error message.

Ed

Attachment: patch30
Description: Text document


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