re PR c++/55944 ([C++11] static local member with constexpr c'tor causes ICE)
/cp 2013-01-22 Paolo Carlini <paolo.carlini@oracle.com> PR c++/55944 * decl.c (check_initializer): Use TARGET_EXPR_DIRECT_INIT_P only on TARGET_EXPR nodes. /testsuite 2013-01-22 Paolo Carlini <paolo.carlini@oracle.com> PR c++/55944 * g++.dg/cpp0x/constexpr-static10.C: New. From-SVN: r195391
This commit is contained in:
parent
c2a452151e
commit
723889fa82
@ -1,3 +1,9 @@
|
||||
2013-01-22 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/55944
|
||||
* decl.c (check_initializer): Use TARGET_EXPR_DIRECT_INIT_P only
|
||||
on TARGET_EXPR nodes.
|
||||
|
||||
2013-01-22 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/56071
|
||||
|
@ -5693,7 +5693,7 @@ check_initializer (tree decl, tree init, int flags, vec<tree, va_gc> **cleanups)
|
||||
&& (!init || TREE_CODE (init) == TREE_LIST))
|
||||
{
|
||||
init = build_functional_cast (type, init, tf_none);
|
||||
if (init != error_mark_node)
|
||||
if (TREE_CODE (init) == TARGET_EXPR)
|
||||
TARGET_EXPR_DIRECT_INIT_P (init) = true;
|
||||
}
|
||||
init_code = NULL_TREE;
|
||||
|
@ -1,3 +1,8 @@
|
||||
2013-01-22 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/55944
|
||||
* g++.dg/cpp0x/constexpr-static10.C: New.
|
||||
|
||||
2013-01-22 Uros Bizjak <ubizjak@gmail.com>
|
||||
|
||||
PR target/56028
|
||||
|
19
gcc/testsuite/g++.dg/cpp0x/constexpr-static10.C
Normal file
19
gcc/testsuite/g++.dg/cpp0x/constexpr-static10.C
Normal file
@ -0,0 +1,19 @@
|
||||
// PR c++/55944
|
||||
// { dg-options -std=c++11 }
|
||||
|
||||
template<class T>
|
||||
struct Test
|
||||
{
|
||||
constexpr Test(T val) : value(val) {}
|
||||
static void test()
|
||||
{
|
||||
static constexpr Test<int> x(42); // ICE
|
||||
}
|
||||
T value;
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
static constexpr Test<int> x(42); // OK
|
||||
Test<double>::test();
|
||||
}
|
Loading…
Reference in New Issue
Block a user