mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-15 16:21:27 +08:00
re PR c++/29633 (syntax error in do/while condition with templates reports incorrect line number)
2012-10-18 Paolo Carlini <paolo.carlini@oracle.com> PR c++/29633 * g++.dg/template/pr29633.C: New. From-SVN: r192570
This commit is contained in:
parent
855828f1b1
commit
0fb2e99454
@ -1,3 +1,8 @@
|
||||
2012-10-18 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/29633
|
||||
* g++.dg/template/pr29633.C: New.
|
||||
|
||||
2012-10-18 Eric Botcazou <ebotcazou@adacore.com>
|
||||
|
||||
* gnat.dg/loop_optimization13.ad[sb]: New test.
|
||||
|
29
gcc/testsuite/g++.dg/template/pr29633.C
Normal file
29
gcc/testsuite/g++.dg/template/pr29633.C
Normal file
@ -0,0 +1,29 @@
|
||||
// PR c++/29633
|
||||
|
||||
template <typename T>
|
||||
struct Class1
|
||||
{
|
||||
void testfn1(void);
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class Class2
|
||||
{
|
||||
public:
|
||||
void testfn2(void)
|
||||
{
|
||||
Class1<T> * tc_a;
|
||||
do
|
||||
{
|
||||
int x = 0;
|
||||
}
|
||||
while (tc_a && tc_a->testfn1); // { dg-error "invalid use of member" }
|
||||
}
|
||||
};
|
||||
|
||||
int main(void)
|
||||
{
|
||||
Class2<int> tc2;
|
||||
tc2.testfn2();
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user