blob: 64a53d2b31e98f2ea680f25bbce94a4cda314d5f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
From c2606fe2aa58ae13a13e7ff0b17da61e4565586d Mon Sep 17 00:00:00 2001
From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
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<typename X>
+struct B: A {
+ static int const b;
+};
+
+template<typename X>
+int const B<X>::b=B<X>::a();
--
1.7.0.4
|