]> granicus.if.org Git - clang/commit
Extend DeclarationName to support C++ overloaded operators, e.g.,
authorDouglas Gregor <dgregor@apple.com>
Tue, 18 Nov 2008 14:39:36 +0000 (14:39 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 18 Nov 2008 14:39:36 +0000 (14:39 +0000)
commite94ca9e4371c022329270436b3dd77adc4ddfa8f
tree88577be07029db31b21b7b0c8e3dbcf593dff4a4
parentdb0e15ae3e2b5e180541eec35e2bce54359ca7d8
Extend DeclarationName to support C++ overloaded operators, e.g.,
operator+, directly, using the same mechanism as all other special
names.

Removed the "special" identifiers for the overloaded operators from
the identifier table and IdentifierInfo data structure. IdentifierInfo
is back to representing only real identifiers.

Added a new Action, ActOnOperatorFunctionIdExpr, that builds an
expression from an parsed operator-function-id (e.g., "operator
+"). ActOnIdentifierExpr used to do this job, but
operator-function-ids are no longer represented by IdentifierInfo's.

Extended Declarator to store overloaded operator names.
Sema::GetNameForDeclarator now knows how to turn the operator
name into a DeclarationName for the overloaded operator.

Except for (perhaps) consolidating the functionality of
ActOnIdentifier, ActOnOperatorFunctionIdExpr, and
ActOnConversionFunctionExpr into a common routine that builds an
appropriate DeclRefExpr by looking up a DeclarationName, all of the
work on normalizing declaration names should be complete with this
commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59526 91177308-0d34-0410-b5e6-96231b3b80d8
18 files changed:
docs/InternalsManual.html
include/clang/AST/DeclarationName.h
include/clang/Basic/IdentifierTable.h
include/clang/Parse/Action.h
include/clang/Parse/DeclSpec.h
include/clang/Parse/Parser.h
lib/AST/Decl.cpp
lib/AST/DeclSerialization.cpp
lib/AST/DeclarationName.cpp
lib/AST/ExprCXX.cpp
lib/Basic/IdentifierTable.cpp
lib/Parse/ParseDecl.cpp
lib/Parse/ParseExprCXX.cpp
lib/Sema/Sema.h
lib/Sema/SemaDecl.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaExprCXX.cpp
test/SemaCXX/overloaded-operator-decl.cpp