diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2013-03-25 20:19:10 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2013-03-25 20:19:10 +0000 |
commit | bbce8a8a36ed1f3809ae785313cce483f4b044fa (patch) | |
tree | 8783d17a7920b3eeea9826582c2e1c55e5e149d4 /gcc | |
parent | 6f6fafc9eff46ac56d9279e86676693f28c088b0 (diff) | |
download | gcc-bbce8a8a36ed1f3809ae785313cce483f4b044fa.zip gcc-bbce8a8a36ed1f3809ae785313cce483f4b044fa.tar.gz gcc-bbce8a8a36ed1f3809ae785313cce483f4b044fa.tar.bz2 |
re PR c++/56722 (C++11: syntax error in for loop ends in SEGV)
/cp
2013-03-25 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/56722
* decl.c (cp_finish_decl): Check DECL_LANG_SPECIFIC before
DECL_TEMPLATE_INSTANTIATION.
/testsuite
2013-03-25 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/56722
* g++.dg/cpp0x/range-for23.C: New.
From-SVN: r197062
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/range-for23.C | 8 |
4 files changed, 21 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0a943a1..1209a8b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2013-03-25 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/56722 + * decl.c (cp_finish_decl): Check DECL_LANG_SPECIFIC before + DECL_TEMPLATE_INSTANTIATION. + 2013-03-22 Jason Merrill <jason@redhat.com> PR c++/56684 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index ea1a08d..2e5910c 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -6111,7 +6111,8 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p, tree d_init; if (init == NULL_TREE) { - if (DECL_TEMPLATE_INSTANTIATION (decl) + if (DECL_LANG_SPECIFIC (decl) + && DECL_TEMPLATE_INSTANTIATION (decl) && !DECL_TEMPLATE_INSTANTIATED (decl)) { /* init is null because we're deferring instantiating the diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index aa2274f..46ad1ec 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-03-25 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/56722 + * g++.dg/cpp0x/range-for23.C: New. + 2013-03-25 Tilo Schwarz <tilo@tilo-schwarz.de> PR libfortran/52512 diff --git a/gcc/testsuite/g++.dg/cpp0x/range-for23.C b/gcc/testsuite/g++.dg/cpp0x/range-for23.C new file mode 100644 index 0000000..849682c0 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/range-for23.C @@ -0,0 +1,8 @@ +// PR c++/56722 +// { dg-do compile { target c++11 } } + +int main() +{ + for (const auto& i, 21) // { dg-error "has no initializer|expected" } + i; +} |