diff options
author | Neil Booth <neil@daikokuya.demon.co.uk> | 2001-12-11 19:42:34 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2001-12-11 19:42:34 +0000 |
commit | 9aa8a1df0506a9622fea14f7c28b73fdd5324f8e (patch) | |
tree | 2018e6f82b3ca5d8eb854a0d321eb3e9f7091dea /gcc/testsuite/gcc.dg/concat.c | |
parent | 0afeef64be52defd45b00c47464183dd43381725 (diff) | |
download | gcc-9aa8a1df0506a9622fea14f7c28b73fdd5324f8e.zip gcc-9aa8a1df0506a9622fea14f7c28b73fdd5324f8e.tar.gz gcc-9aa8a1df0506a9622fea14f7c28b73fdd5324f8e.tar.bz2 |
c-common.c (combine_strings): Complain if concatenating __FUNCTION__.
* c-common.c (combine_strings): Complain if concatenating
__FUNCTION__.
* c-parse.in (yylexname): Flag artificial strings.
* tree.h (TREE_ARTIFICIAL_STRING_P): New.
doc:
* extend.texi: Update.
testsuite:
* gcc.dg/concat.c: New test.
From-SVN: r47890
Diffstat (limited to 'gcc/testsuite/gcc.dg/concat.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/concat.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/concat.c b/gcc/testsuite/gcc.dg/concat.c new file mode 100644 index 0000000..4f4f8d7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/concat.c @@ -0,0 +1,16 @@ +/* Copyright (C) 2001 Free Software Foundation, Inc. */ + +/* { dg-do compile } */ + +/* Test we output a warning for concatenation of artifical strings. + + Neil Booth, 10 Dec 2001. */ + +void foo () +{ + char str1[] = __FUNCTION__ "."; /* { dg-warning "deprecated" } */ + char str2[] = __PRETTY_FUNCTION__ ".";/* { dg-warning "deprecated" } */ + char str3[] = "." __FUNCTION__; /* { dg-warning "deprecated" } */ + char str4[] = "." __PRETTY_FUNCTION__;/* { dg-warning "deprecated" } */ + char str5[] = "." "."; /* No warning. */ +} |