diff options
author | Sean Hunt <rideau3@gmail.com> | 2010-01-13 09:01:02 +0000 |
---|---|---|
committer | Sean Hunt <rideau3@gmail.com> | 2010-01-13 09:01:02 +0000 |
commit | a6c058dd75c5563cced821fc16766a7cc179e00c (patch) | |
tree | 26b721cc5233e697220478b302f8a05691320d85 /lib/AST/Decl.cpp | |
parent | 1248451dcb59c2fe4353611395feb7f7251792bf (diff) |
Implement semantic checking for C++ literal operators.
This now rejects literal operators that don't meet the requirements.
Templates are not yet checked for.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93315 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 49b9c6fc8b..e77661a9fb 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -1039,6 +1039,15 @@ OverloadedOperatorKind FunctionDecl::getOverloadedOperator() const { return OO_None; } +/// getLiteralIdentifier - The literal suffix identifier this function +/// represents, if any. +const IdentifierInfo *FunctionDecl::getLiteralIdentifier() const { + if (getDeclName().getNameKind() == DeclarationName::CXXLiteralOperatorName) + return getDeclName().getCXXLiteralIdentifier(); + else + return 0; +} + FunctionDecl *FunctionDecl::getInstantiatedFromMemberFunction() const { if (MemberSpecializationInfo *Info = getMemberSpecializationInfo()) return cast<FunctionDecl>(Info->getInstantiatedFrom()); |