summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/example-dynarray.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-27 17:07:49 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-27 17:07:49 +0000
commitf98d9b60dbee3f523541b6f8831d1e549e4b0630 (patch)
treedf981cc93c08eeb53a951a26fed1d64fd80dc7a6 /clang/test/SemaTemplate/example-dynarray.cpp
parentbbcf90f9361ae3a7529f023697a01dcde31ad973 (diff)
downloadbcm5719-llvm-f98d9b60dbee3f523541b6f8831d1e549e4b0630.tar.gz
bcm5719-llvm-f98d9b60dbee3f523541b6f8831d1e549e4b0630.zip
Improve name lookup for and template instantiation of declaration
references. There are several smallish fixes here: - Make sure we look through template parameter scope when determining whether we're parsing a nested class (or nested class *template*). This makes sure that we delay parsing the bodies of inline member functions until after we're out of the outermost class (template) scope. - Since the bodies of member functions are always parsed "out-of-line", even when they were declared in-line, teach unqualified name lookup to look into the (semantic) parents. - Use the new InstantiateDeclRef to handle the instantiation of a reference to a declaration (in DeclRefExpr), which drastically simplifies template instantiation for DeclRefExprs. - When we're instantiating a ParmVarDecl, it must be in the current instantiation scope, so only look there. Also, remove the #if 0's and FIXME's from the dynarray example, which now compiles and executes thanks to Anders and Eli. llvm-svn: 72481
Diffstat (limited to 'clang/test/SemaTemplate/example-dynarray.cpp')
-rw-r--r--clang/test/SemaTemplate/example-dynarray.cpp5
1 files changed, 0 insertions, 5 deletions
diff --git a/clang/test/SemaTemplate/example-dynarray.cpp b/clang/test/SemaTemplate/example-dynarray.cpp
index 1fe85d920c3..0fcaba3d9bd 100644
--- a/clang/test/SemaTemplate/example-dynarray.cpp
+++ b/clang/test/SemaTemplate/example-dynarray.cpp
@@ -120,8 +120,6 @@ int main() {
assert(di.size() == 4);
di.push_back(4);
-#if 0
- // FIXME: Copy construction via copy initialization
dynarray<int> di2 = di;
assert(di2.size() == 5);
assert(di.begin() != di2.begin());
@@ -129,7 +127,6 @@ int main() {
I != IEnd; ++I)
assert(*I == I - di2.begin());
- // FIXME: Copy construction via direct initialization
dynarray<int> di3(di);
assert(di3.size() == 5);
assert(di.begin() != di3.begin());
@@ -137,7 +134,6 @@ int main() {
I != IEnd; ++I)
assert(*I == I - di3.begin());
- // FIXME: assignment operator
dynarray<int> di4;
assert(di4.size() == 0);
di4 = di;
@@ -146,7 +142,6 @@ int main() {
for (dynarray<int>::iterator I = di4.begin(), IEnd = di4.end();
I != IEnd; ++I)
assert(*I == I - di4.begin());
-#endif
return 0;
}
OpenPOWER on IntegriCloud