/// isEnd - Returns true if the iterator is one past the end.
bool isEnd() const {
- assert(TST && "InternalalIterator is invalid with a null TST.");
+ assert(TST && "InternalIterator is invalid with a null TST.");
return Index >= TST->getNumArgs();
}
/// &operator++ - Increment the iterator to the next template argument.
InternalIterator &operator++() {
- assert(TST && "InternalalIterator is invalid with a null TST.");
+ assert(TST && "InternalIterator is invalid with a null TST.");
if (isEnd()) {
return *this;
}
/// operator* - Returns the appropriate TemplateArgument.
reference operator*() const {
- assert(TST && "InternalalIterator is invalid with a null TST.");
+ assert(TST && "InternalIterator is invalid with a null TST.");
assert(!isEnd() && "Index exceeds number of arguments.");
if (CurrentTA == EndTA)
return TST->getArg(Index);
/// operator-> - Allow access to the underlying TemplateArgument.
pointer operator->() const {
- assert(TST && "InternalalIterator is invalid with a null TST.");
+ assert(TST && "InternalIterator is invalid with a null TST.");
return &operator*();
}
};
const int *int7(int x) {
const int &x2 = x; // expected-note{{binding reference variable 'x2' here}}
- const int &x3 = x2;
return &x2; // expected-warning{{address of stack memory associated with local variable 'x' returned}}
}
const int *int8(const int &x = 5) {
const int &x2 = x;
- const int &x3 = x2;
return &x2;
}
const int *int9() {
const int &x = 5; // expected-note{{binding reference variable 'x' here}}
const int &x2 = x; // expected-note{{binding reference variable 'x2' here}}
- const int &x3 = x2;
return &x2; // expected-warning{{returning address of local temporary object}}
}
}