aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseExprCXX.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-06 20:58:07 +0000
committerChris Lattner <sabre@nondot.org>2009-12-06 20:58:07 +0000
commit1ade4ca0aa9331c2388cca9becad1357a154ae34 (patch)
treec858d31b3a033c32ae3d0f737b17252b5a3ad35d /lib/Parse/ParseExprCXX.cpp
parentd7d7f67c1dd8626520bb243d3928f59d32424534 (diff)
revert my previous patch, it is breaking something and I don't have time
to fix it ATM. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90717 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseExprCXX.cpp')
-rw-r--r--lib/Parse/ParseExprCXX.cpp26
1 files changed, 2 insertions, 24 deletions
diff --git a/lib/Parse/ParseExprCXX.cpp b/lib/Parse/ParseExprCXX.cpp
index ae2a47befd..4eb6cd5daa 100644
--- a/lib/Parse/ParseExprCXX.cpp
+++ b/lib/Parse/ParseExprCXX.cpp
@@ -45,14 +45,10 @@ using namespace clang;
/// \param EnteringContext whether we will be entering into the context of
/// the nested-name-specifier after parsing it.
///
-/// \param ColonIsSacred - If this is true, then a colon is valid after the
-/// specifier, so we should not try to recover from colons aggressively.
-///
/// \returns true if a scope specifier was parsed.
bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS,
Action::TypeTy *ObjectType,
- bool EnteringContext,
- bool ColonIsSacred) {
+ bool EnteringContext) {
assert(getLang().CPlusPlus &&
"Call sites of this function should be guarded by checking for C++");
@@ -218,29 +214,11 @@ bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS,
// namespace-name '::'
// nested-name-specifier identifier '::'
Token Next = NextToken();
-
- // If we get foo:bar, this is almost certainly a typo for foo::bar. Recover
- // and emit a fixit hint for it.
- if (Next.is(tok::colon) && !ColonIsSacred &&
- Actions.IsInvalidUnlessNestedName(CurScope, SS, II, ObjectType,
- EnteringContext) &&
- // If the token after the colon isn't an identifier, it's still an
- // error, but they probably meant something else strange so don't
- // recover like this.
- PP.LookAhead(1).is(tok::identifier)) {
- Diag(Next, diag::err_unexected_colon_in_nested_name_spec)
- << CodeModificationHint::CreateReplacement(Next.getLocation(), "::");
-
- // Recover as if the user wrote '::'.
- Next.setKind(tok::coloncolon);
- }
-
if (Next.is(tok::coloncolon)) {
// We have an identifier followed by a '::'. Lookup this name
// as the name in a nested-name-specifier.
SourceLocation IdLoc = ConsumeToken();
- assert((Tok.is(tok::coloncolon) || Tok.is(tok::colon)) &&
- "NextToken() not working properly!");
+ assert(Tok.is(tok::coloncolon) && "NextToken() not working properly!");
SourceLocation CCLoc = ConsumeToken();
if (!HasScopeSpecifier) {