summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/instantiate-expr-1.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-02-26 00:01:57 +0000
committerDouglas Gregor <dgregor@apple.com>2010-02-26 00:01:57 +0000
commitde550355c15cd4661c9189018401cd9937ba8804 (patch)
treeabae6fcfded1a194a4be91edd40d8e2e6cfd44ff /clang/test/SemaTemplate/instantiate-expr-1.cpp
parent24c74f1d9ce61bc2034dab3c327e725bb793e05e (diff)
downloadbcm5719-llvm-de550355c15cd4661c9189018401cd9937ba8804.tar.gz
bcm5719-llvm-de550355c15cd4661c9189018401cd9937ba8804.zip
When we decide to re-use an existing CXXConstructExpr node, make sure
to mark the constructor as referenced. Fixes the narrow issue reported in PR6424, but there are a few other places that I'll fix before closing out that PR. llvm-svn: 97185
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-expr-1.cpp')
-rw-r--r--clang/test/SemaTemplate/instantiate-expr-1.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/instantiate-expr-1.cpp b/clang/test/SemaTemplate/instantiate-expr-1.cpp
index d1b05f66a58..4594621103f 100644
--- a/clang/test/SemaTemplate/instantiate-expr-1.cpp
+++ b/clang/test/SemaTemplate/instantiate-expr-1.cpp
@@ -137,3 +137,19 @@ void test_asm() {
int b;
test_asm(b); // expected-note {{in instantiation of function template specialization 'test_asm<int>' requested here}}
}
+
+namespace PR6424 {
+ template<int I> struct X {
+ X() {
+ int *ip = I; // expected-error{{cannot initialize a variable of type 'int *' with an rvalue of type 'int'}}
+ }
+ };
+
+ template<int> struct Y {
+ typedef X<7> X7;
+
+ void f() { X7(); } // expected-note{{instantiation}}
+ };
+
+ template void Y<3>::f();
+}
OpenPOWER on IntegriCloud