public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/67160] New: static_assert feature test macro
@ 2015-08-08 22:29 Casey at Carter dot net
2015-08-18 10:04 ` [Bug c++/67160] " paolo.carlini at oracle dot com
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Casey at Carter dot net @ 2015-08-08 22:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67160
Bug ID: 67160
Summary: static_assert feature test macro
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: Casey at Carter dot net
Target Milestone: ---
Created attachment 36150
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36150&action=edit
Patch
GCC trunk supports static_assert as defined in N3928 (http://wg21.link/n3928)
but defines the feature test macro __cpp_static_assert to the C++11 value
"200410." The appropriate value for N3928 static_assert is "201411" per N4440
(http://wg21.link/n4440#recs.cpp17). Attached patch updates the predefined
value to "201411".
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/67160] static_assert feature test macro
2015-08-08 22:29 [Bug c++/67160] New: static_assert feature test macro Casey at Carter dot net
@ 2015-08-18 10:04 ` paolo.carlini at oracle dot com
2015-08-18 14:39 ` paolo at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-08-18 10:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67160
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2015-08-18
Assignee|unassigned at gcc dot gnu.org |paolo.carlini at oracle dot com
Ever confirmed|0 |1
--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> ---
I think we need something slightly more complex. Looking into it.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/67160] static_assert feature test macro
2015-08-08 22:29 [Bug c++/67160] New: static_assert feature test macro Casey at Carter dot net
2015-08-18 10:04 ` [Bug c++/67160] " paolo.carlini at oracle dot com
@ 2015-08-18 14:39 ` paolo at gcc dot gnu.org
2015-08-18 14:40 ` paolo.carlini at oracle dot com
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: paolo at gcc dot gnu.org @ 2015-08-18 14:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67160
--- Comment #2 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Tue Aug 18 14:38:51 2015
New Revision: 226972
URL: https://gcc.gnu.org/viewcvs?rev=226972&root=gcc&view=rev
Log:
c-family/
2015-08-18 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/67160
* c-cppbuiltin.c (c_cpp_builtins): Fix __cpp_static_assert value
in c++1z mode.
testsuite/
2015-08-18 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/67160
* g++.dg/cpp1z/feat-cxx1z.C: New.
Added:
trunk/gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C
Modified:
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-cppbuiltin.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/67160] static_assert feature test macro
2015-08-08 22:29 [Bug c++/67160] New: static_assert feature test macro Casey at Carter dot net
2015-08-18 10:04 ` [Bug c++/67160] " paolo.carlini at oracle dot com
2015-08-18 14:39 ` paolo at gcc dot gnu.org
@ 2015-08-18 14:40 ` paolo.carlini at oracle dot com
2015-08-18 15:04 ` Casey at Carter dot net
2015-08-18 15:24 ` redi at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-08-18 14:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67160
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
Assignee|paolo.carlini at oracle dot com |unassigned at gcc dot gnu.org
Target Milestone|--- |6.0
Severity|enhancement |normal
--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/67160] static_assert feature test macro
2015-08-08 22:29 [Bug c++/67160] New: static_assert feature test macro Casey at Carter dot net
` (2 preceding siblings ...)
2015-08-18 14:40 ` paolo.carlini at oracle dot com
@ 2015-08-18 15:04 ` Casey at Carter dot net
2015-08-18 15:24 ` redi at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: Casey at Carter dot net @ 2015-08-18 15:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67160
Casey Carter <Casey at Carter dot net> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |Casey at Carter dot net
--- Comment #4 from Casey Carter <Casey at Carter dot net> ---
A quick check with trunk shows that static_assert(true) works as expected with
-std=c++11 and -std=c++14, with an appropriate warning when -pedantic is set.
There seems to be no reason not to unconditionally advertise the availability
of the feature with the feature test macro. Unlike __cplusplus, the SD-6
feature test macros are not standardized so there's no requirement that it be
exactly 200410 in C++11/14 mode.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/67160] static_assert feature test macro
2015-08-08 22:29 [Bug c++/67160] New: static_assert feature test macro Casey at Carter dot net
` (3 preceding siblings ...)
2015-08-18 15:04 ` Casey at Carter dot net
@ 2015-08-18 15:24 ` redi at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2015-08-18 15:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67160
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
And the advantage of the feature-test macro is that users can test for that
specific feature independent of the __cplusplus value.
Of course if it's effected by -pedantic then that means it *isn't* supported
with -std=c++11 -pedantic so the check needs to be more complicated.
In any case, once Paolo says he's done here I'll update
https://gcc.gnu.org/projects/cxx1z.html :-)
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-08-18 15:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-08 22:29 [Bug c++/67160] New: static_assert feature test macro Casey at Carter dot net
2015-08-18 10:04 ` [Bug c++/67160] " paolo.carlini at oracle dot com
2015-08-18 14:39 ` paolo at gcc dot gnu.org
2015-08-18 14:40 ` paolo.carlini at oracle dot com
2015-08-18 15:04 ` Casey at Carter dot net
2015-08-18 15:24 ` redi at gcc dot gnu.org
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).