forked from gcc-mirror/gcc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2017-11-06 Mukesh Kapoor <[email protected]> PR c++/80955 * lex.c (lex_string): When checking for a valid macro for the warning related to -Wliteral-suffix (CPP_W_LITERAL_SUFFIX), check that the macro name does not start with an underscore before calling is_macro(). /gcc/testsuite 2017-11-06 Mukesh Kapoor <[email protected]> PR c++/80955 * g++.dg/cpp0x/udlit-macros.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254443 138bc75d-0d04-0410-961f-82ee72b054a4
- Loading branch information
paolo
committed
Nov 6, 2017
1 parent
baf9f85
commit 3f6f41d
Showing
4 changed files
with
50 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
2017-11-06 Mukesh Kapoor <[email protected]> | ||
|
||
PR c++/80955 | ||
* g++.dg/cpp0x/udlit-macros.C: New. | ||
|
||
2017-11-06 Paul Thomas <[email protected]> | ||
|
||
PR fortran/69739 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// PR c++/80955 | ||
// { dg-do run { target c++11 } } | ||
|
||
extern "C" int sprintf (char *s, const char *format, ...); | ||
extern "C" int strcmp (const char *s1, const char *s2); | ||
|
||
#define __PRI64_PREFIX "l" | ||
#define PRId64 __PRI64_PREFIX "d" | ||
|
||
using size_t = decltype(sizeof(0)); | ||
#define _zero | ||
#define _ID _xx | ||
int operator""_zero(const char*, size_t) { return 0; } | ||
int operator""_ID(const char*, size_t) { return 0; } | ||
|
||
int main() | ||
{ | ||
long i64 = 123; | ||
char buf[100]; | ||
sprintf(buf, "%"PRId64"abc", i64); // { dg-warning "invalid suffix on literal" } | ||
return strcmp(buf, "123abc") | ||
+ ""_zero | ||
+ "bob"_zero | ||
+ R"#(raw | ||
string)#"_zero | ||
+ "xx"_ID | ||
+ ""_ID | ||
+ R"AA(another | ||
raw | ||
string)AA"_ID; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
2017-11-06 Mukesh Kapoor <[email protected]> | ||
|
||
PR c++/80955 | ||
* lex.c (lex_string): When checking for a valid macro for the | ||
warning related to -Wliteral-suffix (CPP_W_LITERAL_SUFFIX), | ||
check that the macro name does not start with an underscore | ||
before calling is_macro(). | ||
|
||
2017-11-05 Tom de Vries <[email protected]> | ||
|
||
PR other/82784 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters