aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2005-09-16 02:50:56 -0400
committerJason Merrill <jason@gcc.gnu.org>2005-09-16 02:50:56 -0400
commit0161fcff945297ee55f7a272813ed06ef68f9a69 (patch)
tree9bfe89c7d86ce0f355b9a48b22672b3c451a222d /gcc
parent07af06f6a312afcedcf9ff51f77cf9daf43bc6fe (diff)
downloadgcc-0161fcff945297ee55f7a272813ed06ef68f9a69.zip
gcc-0161fcff945297ee55f7a272813ed06ef68f9a69.tar.gz
gcc-0161fcff945297ee55f7a272813ed06ef68f9a69.tar.bz2
re PR c++/23357 (ICE with __alignof__ on template arguments)
PR c++/23357 * cp-tree.def (SIZEOF_EXPR, ALIGNOF_EXPR): Change code class to tcc_expression. From-SVN: r104340
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/cp-tree.def4
-rw-r--r--gcc/testsuite/g++.dg/template/sizeof10.C7
3 files changed, 15 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 188189f..683af87 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2005-09-15 Jason Merrill <jason@redhat.com>
+
+ PR c++/23357
+ * cp-tree.def (SIZEOF_EXPR, ALIGNOF_EXPR): Change code class to
+ tcc_expression.
+
2005-09-15 Mark Mitchell <mark@codesourcery.com>
PR c++/23896
diff --git a/gcc/cp/cp-tree.def b/gcc/cp/cp-tree.def
index 096d00a..6b04818 100644
--- a/gcc/cp/cp-tree.def
+++ b/gcc/cp/cp-tree.def
@@ -324,14 +324,14 @@ DEFTREECODE (TINST_LEVEL, "TINST_LEVEL", tcc_exceptional, 0)
DEFTREECODE (OFFSETOF_EXPR, "offsetof_expr", tcc_expression, 1)
/* Represents a 'sizeof' expression during template expansion. */
-DEFTREECODE (SIZEOF_EXPR, "sizeof_expr", tcc_unary, 1)
+DEFTREECODE (SIZEOF_EXPR, "sizeof_expr", tcc_expression, 1)
/* Represents the -> operator during template expansion. */
DEFTREECODE (ARROW_EXPR, "arrow_expr", tcc_expression, 1)
/* Represents an '__alignof__' expression during template
expansion. */
-DEFTREECODE (ALIGNOF_EXPR, "alignof_expr", tcc_unary, 1)
+DEFTREECODE (ALIGNOF_EXPR, "alignof_expr", tcc_expression, 1)
/* A STMT_EXPR represents a statement-expression during template
expansion. This is the GCC extension { ( ... ) }. The
diff --git a/gcc/testsuite/g++.dg/template/sizeof10.C b/gcc/testsuite/g++.dg/template/sizeof10.C
new file mode 100644
index 0000000..5ecf13e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/sizeof10.C
@@ -0,0 +1,7 @@
+// PR c++/23357
+
+template<typename T> bool foo()
+{
+ const long int i = sizeof(T) > 1 ? sizeof(T) : 0;
+ return i > 0;
+}