summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorAlexis Hunt <alercah@gmail.com>2010-01-13 09:01:02 +0000
committerAlexis Hunt <alercah@gmail.com>2010-01-13 09:01:02 +0000
commitc88db06565fc8d07c81f509e44c20a883b560aef (patch)
tree5d6deb29bb4e70428713a38b2eb08a7e2f43c6a3 /clang/lib/AST/Decl.cpp
parent10e2f7264e3454b8dc21d5c03b56014c191ef68d (diff)
downloadbcm5719-llvm-c88db06565fc8d07c81f509e44c20a883b560aef.tar.gz
bcm5719-llvm-c88db06565fc8d07c81f509e44c20a883b560aef.zip
Implement semantic checking for C++ literal operators.
This now rejects literal operators that don't meet the requirements. Templates are not yet checked for. llvm-svn: 93315
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r--clang/lib/AST/Decl.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index 49b9c6fc8b5..e77661a9fbd 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/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());
OpenPOWER on IntegriCloud