* [PATCH 1/9]: C++ P0482R5 char8_t: Documentation updates
@ 2018-11-05 19:39 Tom Honermann
2018-12-03 19:59 ` Jason Merrill
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Tom Honermann @ 2018-11-05 19:39 UTC (permalink / raw)
To: gcc-patches; +Cc: tom
[-- Attachment #1: Type: text/plain, Size: 202 bytes --]
This patch adds documentation for new -fchar8_t and -fno-char8_t options.
gcc/ChangeLog:
2018-11-04 Tom Honermann <tom@honermann.net>
* doc/invoke.texi (-fchar8_t): Document new option.
Tom.
[-- Attachment #2: p0482r5-1.patch --]
[-- Type: text/x-patch, Size: 2725 bytes --]
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 57491f1033c..cd3a2a715db 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -206,7 +206,7 @@ in the following sections.
@item C++ Language Options
@xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
@gccoptlist{-fabi-version=@var{n} -fno-access-control @gol
--faligned-new=@var{n} -fargs-in-order=@var{n} -fcheck-new @gol
+-faligned-new=@var{n} -fargs-in-order=@var{n} -fchar8_t -fcheck-new @gol
-fconstexpr-depth=@var{n} -fconstexpr-loop-limit=@var{n} @gol
-fno-elide-constructors @gol
-fno-enforce-eh-specs @gol
@@ -2432,6 +2432,53 @@ but few users will need to override the default of
This flag is enabled by default for @option{-std=c++17}.
+@item -fchar8_t
+@itemx -fno-char8_t
+@opindex fchar8_t
+@opindex fno-char8_t
+Enable support for the P0482 proposal including the addition of a
+new @code{char8_t} fundamental type, changes to the types of UTF-8
+string and character literals, new signatures for user defined
+literals, and new specializations of standard library class templates
+@code{std::numeric_limits<char8_t>}, @code{std::char_traits<char8_t>},
+and @code{std::hash<char8_t>}.
+
+This option enables functions to be overloaded for ordinary and UTF-8
+strings:
+
+@smallexample
+int f(const char *); // #1
+int f(const char8_t *); // #2
+int v1 = f("text"); // Calls #1
+int v2 = f(u8"text"); // Calls #2
+@end smallexample
+
+and introduces new signatures for user defined literals:
+
+@smallexample
+int operator""_udl1(char8_t);
+int v3 = u8'x'_udl1;
+int operator""_udl2(const char8_t*, std::size_t);
+int v4 = u8"text"_udl2;
+template<typename T, T...> int operator""_udl3();
+int v5 = u8"text"_udl3;
+@end smallexample
+
+The change to the types of UTF-8 string and character literals introduces
+incompatibilities with ISO C++11 and later standards. For example, the
+following code is well-formed under ISO C++11, but is ill-formed when
+@option{-fchar8_t} is specified.
+
+@smallexample
+char ca[] = u8"text"; // error: char-array initialized from wide string
+const char *cp = u8"text"; // error: invalid conversion from 'const char8_t*' to 'const char*'
+int f(const char*);
+auto v = f(u8"text"); // error: invalid conversion from 'const char8_t*' to 'const char*'
+std::string s1@{u8"text"@}; // error: no matching function for call to 'std::basic_string<char>::basic_string()'
+using namespace std::literals;
+std::string s2 = u8"text"s; // error: conversion from 'basic_string<char8_t>' to non-scalar type 'basic_string<char>' requested
+@end smallexample
+
@item -fcheck-new
@opindex fcheck-new
Check that the pointer returned by @code{operator new} is non-null
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/9]: C++ P0482R5 char8_t: Documentation updates
2018-11-05 19:39 [PATCH 1/9]: C++ P0482R5 char8_t: Documentation updates Tom Honermann
@ 2018-12-03 19:59 ` Jason Merrill
2018-12-05 7:10 ` Tom Honermann
2018-12-11 23:35 ` Sandra Loosemore
2018-12-24 2:27 ` [REVISED PATCH " Tom Honermann
2 siblings, 1 reply; 9+ messages in thread
From: Jason Merrill @ 2018-12-03 19:59 UTC (permalink / raw)
To: Tom Honermann, gcc-patches
On 11/5/18 2:39 PM, Tom Honermann wrote:
> This patch adds documentation for new -fchar8_t and -fno-char8_t options.
>
> gcc/ChangeLog:
>
> 2018-11-04 Tom Honermann <tom@honermann.net>
> Â Â Â Â * doc/invoke.texi (-fchar8_t): Document new option.
> +Enable support for the P0482 proposal including the addition of a
> +new @code{char8_t} fundamental type, changes to the types of UTF-8
Now that the proposal has been accepted, I'd refer to C++2a instead.
Jason
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/9]: C++ P0482R5 char8_t: Documentation updates
2018-12-03 19:59 ` Jason Merrill
@ 2018-12-05 7:10 ` Tom Honermann
2018-12-05 15:05 ` Jason Merrill
0 siblings, 1 reply; 9+ messages in thread
From: Tom Honermann @ 2018-12-05 7:10 UTC (permalink / raw)
To: Jason Merrill, gcc-patches
On 12/3/18 2:59 PM, Jason Merrill wrote:
> On 11/5/18 2:39 PM, Tom Honermann wrote:
>> This patch adds documentation for new -fchar8_t and -fno-char8_t
>> options.
>>
>> gcc/ChangeLog:
>>
>> 2018-11-04 Tom Honermann <tom@honermann.net>
>> Â Â Â Â Â * doc/invoke.texi (-fchar8_t): Document new option.
>
>> +Enable support for the P0482 proposal including the addition of a
>> +new @code{char8_t} fundamental type, changes to the types of UTF-8
>
> Now that the proposal has been accepted, I'd refer to C++2a instead.
Agreed. I also need to make the changes to implicitly enable -fchar8_t
with -std=c++2a.
The list of impacted standard library features was incomplete and I
suspect it isn't worth mentioning them specifically. Perhaps mentioning
the feature test macros would be helpful as well?
How does the following sound?
Enable support for @code{char8_t} as adopted for C++2a. This includes
the addition of a new @code{char8_t} fundamental type, changes to the
types of UTF-8 string and character literals, new signatures for user
defined literals, associated standard library updates, and new
@code{__cpp_char8_t} and @code{__cpp_lib_char8_t} feature test macros.
Tom.
>
> Jason
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/9]: C++ P0482R5 char8_t: Documentation updates
2018-12-05 7:10 ` Tom Honermann
@ 2018-12-05 15:05 ` Jason Merrill
0 siblings, 0 replies; 9+ messages in thread
From: Jason Merrill @ 2018-12-05 15:05 UTC (permalink / raw)
To: Tom Honermann; +Cc: gcc-patches List
On Wed, Dec 5, 2018 at 2:10 AM Tom Honermann <tom@honermann.net> wrote:
>
> On 12/3/18 2:59 PM, Jason Merrill wrote:
> > On 11/5/18 2:39 PM, Tom Honermann wrote:
> >> This patch adds documentation for new -fchar8_t and -fno-char8_t
> >> options.
> >>
> >> gcc/ChangeLog:
> >>
> >> 2018-11-04 Tom Honermann <tom@honermann.net>
> >> * doc/invoke.texi (-fchar8_t): Document new option.
> >
> >> +Enable support for the P0482 proposal including the addition of a
> >> +new @code{char8_t} fundamental type, changes to the types of UTF-8
> >
> > Now that the proposal has been accepted, I'd refer to C++2a instead.
>
> Agreed. I also need to make the changes to implicitly enable -fchar8_t
> with -std=c++2a.
>
> The list of impacted standard library features was incomplete and I
> suspect it isn't worth mentioning them specifically. Perhaps mentioning
> the feature test macros would be helpful as well?
>
> How does the following sound?
>
> Enable support for @code{char8_t} as adopted for C++2a. This includes
> the addition of a new @code{char8_t} fundamental type, changes to the
> types of UTF-8 string and character literals, new signatures for user
> defined literals, associated standard library updates, and new
> @code{__cpp_char8_t} and @code{__cpp_lib_char8_t} feature test macros.
Sounds good.
Jason
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/9]: C++ P0482R5 char8_t: Documentation updates
2018-11-05 19:39 [PATCH 1/9]: C++ P0482R5 char8_t: Documentation updates Tom Honermann
2018-12-03 19:59 ` Jason Merrill
@ 2018-12-11 23:35 ` Sandra Loosemore
2018-12-24 2:28 ` Tom Honermann
2018-12-24 2:27 ` [REVISED PATCH " Tom Honermann
2 siblings, 1 reply; 9+ messages in thread
From: Sandra Loosemore @ 2018-12-11 23:35 UTC (permalink / raw)
To: Tom Honermann, gcc-patches
On 11/5/18 12:39 PM, Tom Honermann wrote:
> This patch adds documentation for new -fchar8_t and -fno-char8_t options.
>
> gcc/ChangeLog:
>
> 2018-11-04 Tom Honermann <tom@honermann.net>
> Â Â Â Â * doc/invoke.texi (-fchar8_t): Document new option.
>
My comments are all about nitpicky formatting things.
> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
> index 57491f1033c..cd3a2a715db 100644
> --- a/gcc/doc/invoke.texi
> +++ b/gcc/doc/invoke.texi
> @@ -206,7 +206,7 @@ in the following sections.
> @item C++ Language Options
> @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
> @gccoptlist{-fabi-version=@var{n} -fno-access-control @gol
> --faligned-new=@var{n} -fargs-in-order=@var{n} -fcheck-new @gol
> +-faligned-new=@var{n} -fargs-in-order=@var{n} -fchar8_t -fcheck-new @gol
Please consistently use 2 spaces (not just 1) to separate options on the
same line in a @gccoptlist environment.
> -fconstexpr-depth=@var{n} -fconstexpr-loop-limit=@var{n} @gol
> -fno-elide-constructors @gol
> -fno-enforce-eh-specs @gol
> @@ -2432,6 +2432,53 @@ but few users will need to override the default of
>
> This flag is enabled by default for @option{-std=c++17}.
>
> +@item -fchar8_t
> +@itemx -fno-char8_t
> +@opindex fchar8_t
> +@opindex fno-char8_t
> +Enable support for the P0482 proposal including the addition of a
> +new @code{char8_t} fundamental type, changes to the types of UTF-8
> +string and character literals, new signatures for user defined
> +literals, and new specializations of standard library class templates
> +@code{std::numeric_limits<char8_t>}, @code{std::char_traits<char8_t>},
> +and @code{std::hash<char8_t>}.
> +
> +This option enables functions to be overloaded for ordinary and UTF-8
> +strings:
> +
> +@smallexample
> +int f(const char *); // #1
> +int f(const char8_t *); // #2
> +int v1 = f("text"); // Calls #1
> +int v2 = f(u8"text"); // Calls #2
> +@end smallexample
> +
> +and introduces new signatures for user defined literals:
@noindent immediately before the continued sentence of the paragraph
before the example.
Also please hyphenate "user-defined" here.
> +
> +@smallexample
> +int operator""_udl1(char8_t);
> +int v3 = u8'x'_udl1;
> +int operator""_udl2(const char8_t*, std::size_t);
> +int v4 = u8"text"_udl2;
> +template<typename T, T...> int operator""_udl3();
> +int v5 = u8"text"_udl3;
> +@end smallexample
> +
> +The change to the types of UTF-8 string and character literals introduces
> +incompatibilities with ISO C++11 and later standards. For example, the
> +following code is well-formed under ISO C++11, but is ill-formed when
> +@option{-fchar8_t} is specified.
> +
> +@smallexample
> +char ca[] = u8"text"; // error: char-array initialized from wide string
> +const char *cp = u8"text"; // error: invalid conversion from 'const char8_t*' to 'const char*'
> +int f(const char*);
> +auto v = f(u8"text"); // error: invalid conversion from 'const char8_t*' to 'const char*'
> +std::string s1@{u8"text"@}; // error: no matching function for call to 'std::basic_string<char>::basic_string()'
> +using namespace std::literals;
> +std::string s2 = u8"text"s; // error: conversion from 'basic_string<char8_t>' to non-scalar type 'basic_string<char>' requested
> +@end smallexample
The formatting of this code example is way too wide to fit on the page
of the printed/PDF manual. I suggest putting the comments on separate
lines from the code and breaking them across multiple lines where
necessary. If you format the example for <80 columns it will probably
fit, although you should check the PDF if at all possible.
> +
> @item -fcheck-new
> @opindex fcheck-new
> Check that the pointer returned by @code{operator new} is non-null
>
-Sandra
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [REVISED PATCH 1/9]: C++ P0482R5 char8_t: Documentation updates
2018-11-05 19:39 [PATCH 1/9]: C++ P0482R5 char8_t: Documentation updates Tom Honermann
2018-12-03 19:59 ` Jason Merrill
2018-12-11 23:35 ` Sandra Loosemore
@ 2018-12-24 2:27 ` Tom Honermann
2019-01-05 0:40 ` Martin Sebor
2 siblings, 1 reply; 9+ messages in thread
From: Tom Honermann @ 2018-12-24 2:27 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 440 bytes --]
Attached is a revised patch that addresses feedback provided by Jason
and Sandra. Changes from the prior patch include:
- Updates to the -fchar8_t option documentation as requested by Jason.
- Corrections for indentation, spacing, hyphenation, and wrapping as
requested by Sandra.
Tested on x86_64-linux.
gcc/ChangeLog:
2018-11-04 Tom Honermann <tom@honermann.net>
* doc/invoke.texi (-fchar8_t): Document new option.
Tom.
[-- Attachment #2: p0482r5-1-2.patch --]
[-- Type: text/x-patch, Size: 2913 bytes --]
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 57491f1033c..95374951d98 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -206,7 +206,7 @@ in the following sections.
@item C++ Language Options
@xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
@gccoptlist{-fabi-version=@var{n} -fno-access-control @gol
--faligned-new=@var{n} -fargs-in-order=@var{n} -fcheck-new @gol
+-faligned-new=@var{n} -fargs-in-order=@var{n} -fchar8_t -fcheck-new @gol
-fconstexpr-depth=@var{n} -fconstexpr-loop-limit=@var{n} @gol
-fno-elide-constructors @gol
-fno-enforce-eh-specs @gol
@@ -2432,6 +2432,60 @@ but few users will need to override the default of
This flag is enabled by default for @option{-std=c++17}.
+@item -fchar8_t
+@itemx -fno-char8_t
+@opindex fchar8_t
+@opindex fno-char8_t
+Enable support for @code{char8_t} as adopted for C++2a. This includes
+the addition of a new @code{char8_t} fundamental type, changes to the
+types of UTF-8 string and character literals, new signatures for
+user-defined literals, associated standard library updates, and new
+@code{__cpp_char8_t} and @code{__cpp_lib_char8_t} feature test macros.
+
+This option enables functions to be overloaded for ordinary and UTF-8
+strings:
+
+@smallexample
+int f(const char *); // #1
+int f(const char8_t *); // #2
+int v1 = f("text"); // Calls #1
+int v2 = f(u8"text"); // Calls #2
+@end smallexample
+
+@noindent
+and introduces new signatures for user-defined literals:
+
+@smallexample
+int operator""_udl1(char8_t);
+int v3 = u8'x'_udl1;
+int operator""_udl2(const char8_t*, std::size_t);
+int v4 = u8"text"_udl2;
+template<typename T, T...> int operator""_udl3();
+int v5 = u8"text"_udl3;
+@end smallexample
+
+@noindent
+The change to the types of UTF-8 string and character literals introduces
+incompatibilities with ISO C++11 and later standards. For example, the
+following code is well-formed under ISO C++11, but is ill-formed when
+@option{-fchar8_t} is specified.
+
+@smallexample
+char ca[] = u8"xx"; // error: char-array initialized from wide
+ // string
+const char *cp = u8"xx";// error: invalid conversion from
+ // `const char8_t*' to `const char*'
+int f(const char*);
+auto v = f(u8"xx"); // error: invalid conversion from
+ // `const char8_t*' to `const char*'
+std::string s@{u8"xx"@}; // error: no matching function for call to
+ // `std::basic_string<char>::basic_string()'
+using namespace std::literals;
+s = u8"xx"s; // error: conversion from
+ // `basic_string<char8_t>' to non-scalar
+ // type `basic_string<char>' requested
+@end smallexample
+
@item -fcheck-new
@opindex fcheck-new
Check that the pointer returned by @code{operator new} is non-null
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/9]: C++ P0482R5 char8_t: Documentation updates
2018-12-11 23:35 ` Sandra Loosemore
@ 2018-12-24 2:28 ` Tom Honermann
0 siblings, 0 replies; 9+ messages in thread
From: Tom Honermann @ 2018-12-24 2:28 UTC (permalink / raw)
To: Sandra Loosemore, gcc-patches
Thank you, Sandra! I just sent a revised patch to the list that I
believe addresses all of your comments. Thanks for the suggestion to
generate and check the pdf, that was helpful to ensure the changes
rendered correctly.
Tom.
On 12/11/18 6:35 PM, Sandra Loosemore wrote:
> On 11/5/18 12:39 PM, Tom Honermann wrote:
>> This patch adds documentation for new -fchar8_t and -fno-char8_t
>> options.
>>
>> gcc/ChangeLog:
>>
>> 2018-11-04 Tom Honermann <tom@honermann.net>
>> Â Â Â Â Â * doc/invoke.texi (-fchar8_t): Document new option.
>>
>
> My comments are all about nitpicky formatting things.
>
>> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
>> index 57491f1033c..cd3a2a715db 100644
>> --- a/gcc/doc/invoke.texi
>> +++ b/gcc/doc/invoke.texi
>> @@ -206,7 +206,7 @@ in the following sections.
>> Â @item C++ Language Options
>> Â @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
>> Â @gccoptlist{-fabi-version=@var{n}Â -fno-access-control @gol
>> --faligned-new=@var{n}Â -fargs-in-order=@var{n}Â -fcheck-new @gol
>> +-faligned-new=@var{n}Â -fargs-in-order=@var{n}Â -fchar8_t
>> -fcheck-new @gol
>
> Please consistently use 2 spaces (not just 1) to separate options on
> the same line in a @gccoptlist environment.
>
>> Â -fconstexpr-depth=@var{n} -fconstexpr-loop-limit=@var{n} @gol
>> Â -fno-elide-constructors @gol
>> Â -fno-enforce-eh-specs @gol
>> @@ -2432,6 +2432,53 @@ but few users will need to override the
>> default of
>>
>> Â This flag is enabled by default for @option{-std=c++17}.
>>
>> +@item -fchar8_t
>> +@itemx -fno-char8_t
>> +@opindex fchar8_t
>> +@opindex fno-char8_t
>> +Enable support for the P0482 proposal including the addition of a
>> +new @code{char8_t} fundamental type, changes to the types of UTF-8
>> +string and character literals, new signatures for user defined
>> +literals, and new specializations of standard library class templates
>> +@code{std::numeric_limits<char8_t>}, @code{std::char_traits<char8_t>},
>> +and @code{std::hash<char8_t>}.
>> +
>> +This option enables functions to be overloaded for ordinary and UTF-8
>> +strings:
>> +
>> +@smallexample
>> +int f(const char *);Â Â Â // #1
>> +int f(const char8_t *); // #2
>> +int v1 = f("text");Â Â Â Â // Calls #1
>> +int v2 = f(u8"text");Â Â // Calls #2
>> +@end smallexample
>> +
>> +and introduces new signatures for user defined literals:
>
> @noindent immediately before the continued sentence of the paragraph
> before the example.
>
> Also please hyphenate "user-defined" here.
>
>> +
>> +@smallexample
>> +int operator""_udl1(char8_t);
>> +int v3 = u8'x'_udl1;
>> +int operator""_udl2(const char8_t*, std::size_t);
>> +int v4 = u8"text"_udl2;
>> +template<typename T, T...> int operator""_udl3();
>> +int v5 = u8"text"_udl3;
>> +@end smallexample
>> +
>> +The change to the types of UTF-8 string and character literals
>> introduces
>> +incompatibilities with ISO C++11 and later standards. For example, the
>> +following code is well-formed under ISO C++11, but is ill-formed when
>> +@option{-fchar8_t} is specified.
>> +
>> +@smallexample
>> +char ca[] = u8"text";Â Â Â Â Â Â // error: char-array initialized from
>> wide string
>> +const char *cp = u8"text";Â // error: invalid conversion from 'const
>> char8_t*' to 'const char*'
>> +int f(const char*);
>> +auto v = f(u8"text");Â Â Â Â Â Â // error: invalid conversion from 'const
>> char8_t*' to 'const char*'
>> +std::string s1@{u8"text"@};Â Â // error: no matching function for
>> call to 'std::basic_string<char>::basic_string()'
>> +using namespace std::literals;
>> +std::string s2 = u8"text"s; // error: conversion from
>> 'basic_string<char8_t>' to non-scalar type 'basic_string<char>'
>> requested
>> +@end smallexample
>
> The formatting of this code example is way too wide to fit on the page
> of the printed/PDF manual. I suggest putting the comments on separate
> lines from the code and breaking them across multiple lines where
> necessary. If you format the example for <80 columns it will probably
> fit, although you should check the PDF if at all possible.
>
>> +
>> Â @item -fcheck-new
>> Â @opindex fcheck-new
>> Â Check that the pointer returned by @code{operator new} is non-null
>>
>
> -Sandra
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [REVISED PATCH 1/9]: C++ P0482R5 char8_t: Documentation updates
2018-12-24 2:27 ` [REVISED PATCH " Tom Honermann
@ 2019-01-05 0:40 ` Martin Sebor
2019-01-15 4:30 ` Tom Honermann
0 siblings, 1 reply; 9+ messages in thread
From: Martin Sebor @ 2019-01-05 0:40 UTC (permalink / raw)
To: Tom Honermann, gcc-patches
On 12/23/18 7:27 PM, Tom Honermann wrote:
> Attached is a revised patch that addresses feedback provided by Jason
> and Sandra. Changes from the prior patch include:
> - Updates to the -fchar8_t option documentation as requested by Jason.
> - Corrections for indentation, spacing, hyphenation, and wrapping as
> Â requested by Sandra.
>
Just a minor nit that backticks in code examples should be avoided
(per the TexInfo manual, they can cause trouble when copying code
from PDF readers):
+@smallexample
+char ca[] = u8"xx"; // error: char-array initialized from wide
+ // string
+const char *cp = u8"xx";// error: invalid conversion from
+ // `const char8_t*' to `const char*'
Martin
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [REVISED PATCH 1/9]: C++ P0482R5 char8_t: Documentation updates
2019-01-05 0:40 ` Martin Sebor
@ 2019-01-15 4:30 ` Tom Honermann
0 siblings, 0 replies; 9+ messages in thread
From: Tom Honermann @ 2019-01-15 4:30 UTC (permalink / raw)
To: Martin Sebor, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 1179 bytes --]
On 1/4/19 7:40 PM, Martin Sebor wrote:
> On 12/23/18 7:27 PM, Tom Honermann wrote:
>> Attached is a revised patch that addresses feedback provided by Jason
>> and Sandra. Changes from the prior patch include:
>> - Updates to the -fchar8_t option documentation as requested by Jason.
>> - Corrections for indentation, spacing, hyphenation, and wrapping as
>> Â Â requested by Sandra.
>>
>
> Just a minor nit that backticks in code examples should be avoided
> (per the TexInfo manual, they can cause trouble when copying code
> from PDF readers):
>
> +@smallexample
> +char ca[] = u8"xx";Â Â Â Â // error: char-array initialized from wide
> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â //Â Â Â Â Â Â Â string
> +const char *cp = u8"xx";// error: invalid conversion from
> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â //Â Â Â Â Â Â Â `const char8_t*' to `const char*'
Thanks for catching that, Martin. Patch relative to trunk (r267930)
attached to correct this (Jason already committed the original change).
Tom.
>
> Martin
[-- Attachment #2: char8_t-doc-update.diff --]
[-- Type: text/x-patch, Size: 1360 bytes --]
Index: gcc/doc/invoke.texi
===================================================================
--- gcc/doc/invoke.texi (revision 267930)
+++ gcc/doc/invoke.texi (working copy)
@@ -2468,16 +2468,16 @@
char ca[] = u8"xx"; // error: char-array initialized from wide
// string
const char *cp = u8"xx";// error: invalid conversion from
- // `const char8_t*' to `const char*'
+ // 'const char8_t*' to 'const char*'
int f(const char*);
auto v = f(u8"xx"); // error: invalid conversion from
- // `const char8_t*' to `const char*'
+ // 'const char8_t*' to 'const char*'
std::string s@{u8"xx"@}; // error: no matching function for call to
- // `std::basic_string<char>::basic_string()'
+ // 'std::basic_string<char>::basic_string()'
using namespace std::literals;
s = u8"xx"s; // error: conversion from
- // `basic_string<char8_t>' to non-scalar
- // type `basic_string<char>' requested
+ // 'basic_string<char8_t>' to non-scalar
+ // type 'basic_string<char>' requested
@end smallexample
@item -fcheck-new
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2019-01-15 4:30 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-05 19:39 [PATCH 1/9]: C++ P0482R5 char8_t: Documentation updates Tom Honermann
2018-12-03 19:59 ` Jason Merrill
2018-12-05 7:10 ` Tom Honermann
2018-12-05 15:05 ` Jason Merrill
2018-12-11 23:35 ` Sandra Loosemore
2018-12-24 2:28 ` Tom Honermann
2018-12-24 2:27 ` [REVISED PATCH " Tom Honermann
2019-01-05 0:40 ` Martin Sebor
2019-01-15 4:30 ` Tom Honermann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).