summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/expr/expr.prim/expr.prim.general
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-01-18 03:53:45 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-01-18 03:53:45 +0000
commit7bda7f75332017d54e9e3504b8991eaddb7486e3 (patch)
treef603c3582fd08cfc8aabeba91904a24373f69a18 /clang/test/CXX/expr/expr.prim/expr.prim.general
parent9ed5b156a27a972ca1423aa25638f239cdc2ffc0 (diff)
downloadbcm5719-llvm-7bda7f75332017d54e9e3504b8991eaddb7486e3.tar.gz
bcm5719-llvm-7bda7f75332017d54e9e3504b8991eaddb7486e3.zip
Make PotentiallyPotentiallyEvaluated contexts work correctly when referencing a class field from outside an instance method.
llvm-svn: 148376
Diffstat (limited to 'clang/test/CXX/expr/expr.prim/expr.prim.general')
-rw-r--r--clang/test/CXX/expr/expr.prim/expr.prim.general/p12-0x.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/CXX/expr/expr.prim/expr.prim.general/p12-0x.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.general/p12-0x.cpp
index 4a2dccff90a..bc052e35b8b 100644
--- a/clang/test/CXX/expr/expr.prim/expr.prim.general/p12-0x.cpp
+++ b/clang/test/CXX/expr/expr.prim/expr.prim.general/p12-0x.cpp
@@ -19,3 +19,11 @@ struct T {
int b[sizeof n]; // ok
}
};
+
+// Make sure the rule for unevaluated operands works correctly with typeid.
+namespace std {
+ class type_info;
+}
+class Poly { virtual ~Poly(); };
+const std::type_info& k = typeid(S::m);
+const std::type_info& m = typeid(*(Poly*)S::m); // expected-error {{invalid use of nonstatic data member}}
OpenPOWER on IntegriCloud