From c2606fe2aa58ae13a13e7ff0b17da61e4565586d Mon Sep 17 00:00:00 2001 From: jason Date: Mon, 25 Apr 2011 21:53:57 +0000 Subject: [PATCH 178/200] PR c++/48707 * pt.c (value_dependent_expression_p): Handle type-dependent expression. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@172942 138bc75d-0d04-0410-961f-82ee72b054a4 index ed48203..fc5177d 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -18068,6 +18068,11 @@ value_dependent_expression_p (tree expression) if (DECL_P (expression) && type_dependent_expression_p (expression)) return true; + /* We shouldn't have gotten here for a type-dependent expression, but + let's handle it properly anyway. */ + if (TREE_TYPE (expression) == NULL_TREE) + return true; + switch (TREE_CODE (expression)) { case IDENTIFIER_NODE: new file mode 100644 index 0000000..25354b3 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/regress/template-const2.C @@ -0,0 +1,14 @@ +// PR c++/48707 +// { dg-options -std=c++0x } + +struct A { + static int a(); +}; + +template +struct B: A { + static int const b; +}; + +template +int const B::b=B::a(); -- 1.7.0.4