This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCHes to help with C++11 bootstrap
- From: Markus Trippelsdorf <markus at trippelsdorf dot de>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 9 May 2015 20:27:46 +0200
- Subject: Re: PATCHes to help with C++11 bootstrap
- Authentication-results: sourceware.org; auth=none
- References: <554D8D79 dot 9080502 at redhat dot com>
On 2015.05.08 at 23:30 -0500, Jason Merrill wrote:
> One C++11 compatibility issue that turns up a lot in the GCC sources is
> that in C++98,
>
> #define BAR "bar"
> const char *p = "foo"BAR;
>
> is well-formed, giving p the value "foobar". But in C++11 this is a
> user-defined literal with the suffix BAR, which is ill-formed because
> there is no BAR suffix defined.
>
> -Wc++11-compat didn't warn about this, which I'm fixing with the first
> patch.
>
> The second patch fixes all the occurrences in GCC.
>
> The third patch fixes the warning to say "-Wc++11-compat" rather than
> "-Wc++0x-compat".
This also enables the following bogus warning:
~ % cat test.cpp
template <int> struct X {};
template <typename> struct Y { static int const c = 0; };
int main() { return Y<X<1>>::c; }
~ % g++ -Wall -std=c++11 test.cpp
test.cpp: In function âint main()â:
test.cpp:3:26: warning: â>>â operator is treated as two right angle brackets in C++11 [-Wc++11-compat]
int main() { return Y<X<1>>::c; }
^
test.cpp:3:26: note: suggest parentheses around â>>â expression
--
Markus