Commiting a revert from dgregor of a bit of destructor logic until we can

figure out how not to break lots of code using this. See PR6358 and PR6359 for
motivating examples. FIXME's left in the code and the test.

llvm-svn: 96733
This commit is contained in:
Chandler Carruth 2010-02-21 10:19:54 +00:00
parent 4e5d6788b3
commit 8f2548112e
2 changed files with 12 additions and 18 deletions

View File

@ -66,32 +66,26 @@ Action::TypeTy *Sema::getDestructorName(SourceLocation TildeLoc,
// If a pseudo-destructor-name (5.2.4) contains a // If a pseudo-destructor-name (5.2.4) contains a
// nested-name-specifier, the type-names are looked up as types // nested-name-specifier, the type-names are looked up as types
// in the scope designated by the nested-name-specifier. Similarly, in // in the scope designated by the nested-name-specifier. Similarly, in
// a qualified-id of theform: // a qualified-id of the form:
// //
// :: [opt] nested-name-specifier[opt] class-name :: ~class-name // :: [opt] nested-name-specifier[opt] class-name :: ~class-name
// //
// the second class-name is looked up in the same scope as the first. // the second class-name is looked up in the same scope as the first.
// //
// To implement this, we look at the prefix of the // FIXME: We don't implement this, because it breaks lots of
// nested-name-specifier we were given, and determine the lookup // perfectly reasonable code that no other compilers diagnose. The
// context from that. // issue is that the first class-name is looked up as a
NestedNameSpecifier *NNS = (NestedNameSpecifier *)SS.getScopeRep(); // nested-name-specifier, so we ignore value declarations, but the
if (NestedNameSpecifier *Prefix = NNS->getPrefix()) { // second lookup is presumably an ordinary name lookup. Hence, we
CXXScopeSpec PrefixSS; // end up finding values (say, a function) and complain. See PRs
PrefixSS.setScopeRep(Prefix); // 6358 and 6359 for examples of such code. DPG to investigate
LookupCtx = computeDeclContext(PrefixSS, EnteringContext); // further.
isDependent = isDependentScopeSpecifier(PrefixSS); if (ObjectTypePtr) {
} else if (ObjectTypePtr) {
LookupCtx = computeDeclContext(SearchType); LookupCtx = computeDeclContext(SearchType);
isDependent = SearchType->isDependentType(); isDependent = SearchType->isDependentType();
} else { } else {
LookupCtx = computeDeclContext(SS, EnteringContext); LookupCtx = computeDeclContext(SS, EnteringContext);
if (LookupCtx && !LookupCtx->isTranslationUnit()) { isDependent = LookupCtx->isDependentContext();
LookupCtx = LookupCtx->getParent();
isDependent = LookupCtx->isDependentContext();
} else {
isDependent = false;
}
} }
LookInScope = false; LookInScope = false;

View File

@ -28,7 +28,7 @@ void f(A* a, Foo *f, int *i) {
g().~Bar(); // expected-error{{non-scalar}} g().~Bar(); // expected-error{{non-scalar}}
f->::~Bar(); f->::~Bar();
f->N::~Wibble(); // expected-error{{expected the class name after '~' to name a destructor}} f->N::~Wibble(); // FIXME: Cannot use typedef name in destructor id.
f->::~Bar(17, 42); // expected-error{{cannot have any arguments}} f->::~Bar(17, 42); // expected-error{{cannot have any arguments}}
} }