re PR c++/10468 (const typeof(x) is non-const, but only in templates)
PR c++/10468 * pt.c (tsubst): Handle qualified TYPEOF_TYPEs correctly. PR c++/10468 * g++.dg/ext/typeof5.C: New test. From-SVN: r68615
This commit is contained in:
parent
7a0ec6071b
commit
dce50630a3
@ -1,3 +1,8 @@
|
||||
2003-06-27 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/10468
|
||||
* pt.c (tsubst): Handle qualified TYPEOF_TYPEs correctly.
|
||||
|
||||
2003-06-27 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/10796
|
||||
|
@ -7062,7 +7062,10 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
|
||||
if (e1 == error_mark_node)
|
||||
return error_mark_node;
|
||||
|
||||
return TREE_TYPE (e1);
|
||||
return cp_build_qualified_type_real (TREE_TYPE (e1),
|
||||
cp_type_quals (t)
|
||||
| cp_type_quals (TREE_TYPE (e1)),
|
||||
complain);
|
||||
}
|
||||
|
||||
default:
|
||||
|
@ -1,3 +1,8 @@
|
||||
2003-06-27 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/10468
|
||||
* g++.dg/ext/typeof6.C: New test.
|
||||
|
||||
2003-06-27 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
PR c++/10796
|
||||
|
17
gcc/testsuite/g++.dg/ext/typeof6.C
Normal file
17
gcc/testsuite/g++.dg/ext/typeof6.C
Normal file
@ -0,0 +1,17 @@
|
||||
// { dg-options "" }
|
||||
|
||||
template <class T>
|
||||
void test1() {
|
||||
int x = 0;
|
||||
const typeof(x) & t1 = x+0;
|
||||
}
|
||||
|
||||
void test2() {
|
||||
int x = 0;
|
||||
const typeof(x) & t1 = x+0;
|
||||
}
|
||||
|
||||
int main() {
|
||||
test1<int>();
|
||||
test2 ();
|
||||
}
|
Loading…
Reference in New Issue
Block a user