PR c++/28284
* pt.c (fold_non_dependent_expr): Make sure expr is not dereferenced if it
is NULL.
From-SVN: r116755
+2006-09-07 Simon Martin <simartin@users.sourceforge.net>
+
+ PR c++/28284
+ * pt.c (fold_non_dependent_expr): Make sure expr is not dereferenced if it
+ is NULL.
+
2006-09-06 Zak Kipling <zak@transversal.com>
PR c++/26195
tree
fold_non_dependent_expr (tree expr)
{
+ if (expr == NULL_TREE)
+ return NULL_TREE;
+
/* If we're in a template, but EXPR isn't value dependent, simplify
it. We're supposed to treat:
--- /dev/null
+/* { dg-do compile } */
+
+template<int> struct A
+{
+ static const int i=x; /* { dg-error "was not declared in this scope" } */
+ static const int j, k;
+};
+
+template<int N> const int A<N>::j = i;
+template<int N> const int A<N>::k = j;
+
+A<0> a;