diff options
author | Jakub Jelinek <jakub@redhat.com> | 2013-04-28 23:36:57 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2013-04-28 23:36:57 +0200 |
commit | 01187df0970be20c06628f280ce07524db49d585 (patch) | |
tree | befd3b677796bad370f79def6822510edc236a34 /gcc | |
parent | 5e67a36916b402a029a7b1a5a86355ddbc75ef75 (diff) | |
download | gcc-01187df0970be20c06628f280ce07524db49d585.zip gcc-01187df0970be20c06628f280ce07524db49d585.tar.gz gcc-01187df0970be20c06628f280ce07524db49d585.tar.bz2 |
N3472 binary constants
N3472 binary constants
* include/cpplib.h (struct cpp_options): Fix a typo in user_literals
field comment. Add binary_constants field.
* init.c (struct lang_flags): Add binary_constants field.
(lang_defaults): Add bin_cst column to the table.
(cpp_set_lang): Initialize CPP_OPTION (pfile, binary_constants).
* expr.c (cpp_classify_number): Talk about C++11 instead of C++0x
in diagnostics. Accept binary constants if
CPP_OPTION (pfile, binary_constants) even when pedantic. Adjust
pedwarn message.
* g++.dg/cpp/limits.C: Adjust warning wording.
* g++.dg/system-binary-constants-1.C: Likewise.
* g++.dg/cpp1y/system-binary-constants-1.C: New test.
From-SVN: r198380
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp/limits.C | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp1y/system-binary-constants-1.C | 14 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/system-binary-constants-1.C | 2 |
4 files changed, 25 insertions, 4 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 36ce9f0..cf34657 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2013-04-28 Jakub Jelinek <jakub@redhat.com> + + N3472 binary constants + * g++.dg/cpp/limits.C: Adjust warning wording. + * g++.dg/system-binary-constants-1.C: Likewise. + * g++.dg/cpp1y/system-binary-constants-1.C: New test. + 2013-04-28 Tobias Burnus <burnus@net-b.de> PR fortran/57093 diff --git a/gcc/testsuite/g++.dg/cpp/limits.C b/gcc/testsuite/g++.dg/cpp/limits.C index b64e1e2..5824e01 100644 --- a/gcc/testsuite/g++.dg/cpp/limits.C +++ b/gcc/testsuite/g++.dg/cpp/limits.C @@ -4,13 +4,13 @@ #include <limits> // Compiling this with -pedantic was wrongly triggering this error: -// libstdc++-v3/include/limits:1269:45: warning : use of C++0x long long integer constant [-Wlong-long] +// libstdc++-v3/include/limits:1269:45: warning : use of C++11 long long integer constant [-Wlong-long] // min() _GLIBCXX_USE_NOEXCEPT { return -__LONG_LONG_MAX__ - 1; } // ^ -// libstdc++-v3/include/limits:1272:44: warning : use of C++0x long long integer constant [-Wlong-long] +// libstdc++-v3/include/limits:1272:44: warning : use of C++11 long long integer constant [-Wlong-long] // max() _GLIBCXX_USE_NOEXCEPT { return __LONG_LONG_MAX__; } // ^ -// libstdc++-v3/include/limits:1342:44: warning : use of C++0x long long integer constant [-Wlong-long] +// libstdc++-v3/include/limits:1342:44: warning : use of C++11 long long integer constant [-Wlong-long] // max() _GLIBCXX_USE_NOEXCEPT { return __LONG_LONG_MAX__ * 2ULL + 1 // ^ diff --git a/gcc/testsuite/g++.dg/cpp1y/system-binary-constants-1.C b/gcc/testsuite/g++.dg/cpp1y/system-binary-constants-1.C new file mode 100644 index 0000000..fe97127 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/system-binary-constants-1.C @@ -0,0 +1,14 @@ +// Origin: Dodji Seketeli <dodji@redhat.com> +// { dg-options "-std=c++1y -pedantic-errors" } +// { dg-do compile } + +#include "../system-binary-constants-1.h" + +int +foo (void) +{ +#if BINARY_INT_CONSTANT_IN_SYSTEM_HEADER + return 23; +#endif + return 0b1101; // { dg-bogus "binary constants are a C..1y feature or GCC extension" } +} diff --git a/gcc/testsuite/g++.dg/system-binary-constants-1.C b/gcc/testsuite/g++.dg/system-binary-constants-1.C index 7ef26f7..fbf8bb2 100644 --- a/gcc/testsuite/g++.dg/system-binary-constants-1.C +++ b/gcc/testsuite/g++.dg/system-binary-constants-1.C @@ -14,5 +14,5 @@ foo (void) warning. */ return 23; #endif - return 0b1101; /* { dg-warning "binary constants are a GCC extension" } */ + return 0b1101; /* { dg-warning "binary constants are a C..1y feature or GCC extension" } */ } |