From 0fb2e99454910a5071743ccb924223ca3df33d36 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Thu, 18 Oct 2012 17:02:10 +0000 Subject: [PATCH] re PR c++/29633 (syntax error in do/while condition with templates reports incorrect line number) 2012-10-18 Paolo Carlini PR c++/29633 * g++.dg/template/pr29633.C: New. From-SVN: r192570 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/template/pr29633.C | 29 +++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 gcc/testsuite/g++.dg/template/pr29633.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7ed81b9f5e7..98c4815eeda 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-10-18 Paolo Carlini + + PR c++/29633 + * g++.dg/template/pr29633.C: New. + 2012-10-18 Eric Botcazou * gnat.dg/loop_optimization13.ad[sb]: New test. diff --git a/gcc/testsuite/g++.dg/template/pr29633.C b/gcc/testsuite/g++.dg/template/pr29633.C new file mode 100644 index 00000000000..3e0254a46e4 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/pr29633.C @@ -0,0 +1,29 @@ +// PR c++/29633 + +template +struct Class1 +{ + void testfn1(void); +}; + +template +class Class2 +{ +public: + void testfn2(void) + { + Class1 * tc_a; + do + { + int x = 0; + } + while (tc_a && tc_a->testfn1); // { dg-error "invalid use of member" } + } +}; + +int main(void) +{ + Class2 tc2; + tc2.testfn2(); + return 0; +} -- 2.11.4.GIT