aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r--lib/Parse/ParseDecl.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index e1fbb6dfca..0b3063148b 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -1305,6 +1305,15 @@ void Parser::ParseDirectDeclarator(Declarator &D) {
if (TypeTy *Type = ParseClassName())
D.SetDestructor(Type, II, TildeLoc);
+ } else if (Tok.is(tok::kw_operator)) {
+ SourceLocation OperatorLoc = Tok.getLocation();
+
+ // First try the name of an overloaded operator
+ if (IdentifierInfo *II = MaybeParseOperatorFunctionId()) {
+ D.SetIdentifier(II, OperatorLoc);
+ } else {
+ // This must be a user-defined conversion.
+ }
} else if (Tok.is(tok::l_paren)) {
// direct-declarator: '(' declarator ')'
// direct-declarator: '(' attributes declarator ')'