aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorMark Mitchell <mmitchel@gcc.gnu.org>2001-11-20 05:09:34 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2001-11-20 05:09:34 +0000
commit78a40378a9f48026652466b824b68f0a949f39ee (patch)
tree2669e6486e7ce424050fd284519d6fa62f1413da /gcc/testsuite
parent34f62c3635821b9a5501031de5e3af0ef93d4189 (diff)
downloadgcc-78a40378a9f48026652466b824b68f0a949f39ee.zip
gcc-78a40378a9f48026652466b824b68f0a949f39ee.tar.gz
gcc-78a40378a9f48026652466b824b68f0a949f39ee.tar.bz2
re PR c++/4629 (non-constant `sizeof (void*)' cannot be used as template argument)
* dump.c (dump_op): New function. (cp_dump_tree): Dump CLASSTYPE_TEMPLATE_SPECIALIZATION. Use dump_op. Dump DECL_MUTABLE, access and staticness for VAR_DECLs. DECL_PURE_VIRTUAL_P, DECL_VIRTUAL_P, PR4629 * semantics.c (finish_sizeof): Make sure that expression created while processing a template do not have a type. (finish_alignof): Likewise. * typeck.c (c_sizeof): Likewise. (expr_sizeof): Likewise. From-SVN: r47201
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/g++.dg/sizeof1.C15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/sizeof1.C b/gcc/testsuite/g++.dg/sizeof1.C
new file mode 100644
index 0000000..328d647
--- /dev/null
+++ b/gcc/testsuite/g++.dg/sizeof1.C
@@ -0,0 +1,15 @@
+// Test use of `sizeof' as a template parameter.
+// Origin: smacdonald@seimac.com
+
+// { dg-do compile }
+
+template <unsigned I> struct A {};
+
+template <typename SizeType>
+struct B
+{
+char * f() const
+{
+return (A<sizeof(void *)>::value);
+}
+};