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: PATCHes to help with C++11 bootstrap


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


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