mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-20 09:35:05 +08:00
re PR c++/55425 (constexpr does not work in many situations (both built-in and user supplied literals))
/cp 2014-11-19 Paolo Carlini <paolo.carlini@oracle.com> PR c++/55425 * constexpr.c (constexpr_fn_retval): Accept __func__, __FUNCTION__, and __PRETTY_FUNCTION__. /testsuite 2014-11-19 Paolo Carlini <paolo.carlini@oracle.com> PR c++/55425 * g++.dg/cpp0x/constexpr-__func__.C From-SVN: r217788
This commit is contained in:
parent
538dd0b78f
commit
0162cb3bb7
@ -1,3 +1,9 @@
|
||||
2014-11-19 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/55425
|
||||
* constexpr.c (constexpr_fn_retval): Accept __func__, __FUNCTION__,
|
||||
and __PRETTY_FUNCTION__.
|
||||
|
||||
2014-11-18 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/63924
|
||||
|
@ -616,9 +616,14 @@ constexpr_fn_retval (tree body)
|
||||
return break_out_target_exprs (TREE_OPERAND (body, 0));
|
||||
|
||||
case DECL_EXPR:
|
||||
if (TREE_CODE (DECL_EXPR_DECL (body)) == USING_DECL)
|
||||
return NULL_TREE;
|
||||
return error_mark_node;
|
||||
{
|
||||
tree decl = DECL_EXPR_DECL (body);
|
||||
if (TREE_CODE (decl) == USING_DECL
|
||||
/* Accept __func__, __FUNCTION__, and __PRETTY_FUNCTION__. */
|
||||
|| DECL_ARTIFICIAL (decl))
|
||||
return NULL_TREE;
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
case CLEANUP_POINT_EXPR:
|
||||
return constexpr_fn_retval (TREE_OPERAND (body, 0));
|
||||
|
@ -1,11 +1,17 @@
|
||||
2014-11-19 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/55425
|
||||
* g++.dg/cpp0x/constexpr-__func__.C
|
||||
|
||||
2014-11-19 Renlin Li <Renlin.Li@arm.com>
|
||||
PR target/63424
|
||||
|
||||
PR target/63424
|
||||
* gcc.target/aarch64/pr63424.c: New test.
|
||||
|
||||
2014-11-19 Renlin Li <Renlin.Li@arm.com>
|
||||
|
||||
PR middle-end/63762
|
||||
* gcc.dg/pr63762.c: New test.
|
||||
PR middle-end/63762
|
||||
* gcc.dg/pr63762.c: New test.
|
||||
|
||||
2014-11-19 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
|
6
gcc/testsuite/g++.dg/cpp0x/constexpr-__func__.C
Normal file
6
gcc/testsuite/g++.dg/cpp0x/constexpr-__func__.C
Normal file
@ -0,0 +1,6 @@
|
||||
// PR c++/55425
|
||||
// { dg-do compile { target c++11 } }
|
||||
|
||||
constexpr const char* x() { return __func__; }
|
||||
constexpr const char* y() { return __FUNCTION__; }
|
||||
constexpr const char* z() { return __PRETTY_FUNCTION__; }
|
Loading…
Reference in New Issue
Block a user