summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.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/Sema/SemaDecl.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/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 59cb447ecd6..e53f141c960 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -3487,7 +3487,12 @@ void Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD,
if (NewFD->isOverloadedOperator() &&
CheckOverloadedOperatorDeclaration(NewFD))
return NewFD->setInvalidDecl();
-
+
+ // Extra checking for C++0x literal operators (C++0x [over.literal]).
+ if (NewFD->getLiteralIdentifier() &&
+ CheckLiteralOperatorDeclaration(NewFD))
+ return NewFD->setInvalidDecl();
+
// In C++, check default arguments now that we have merged decls. Unless
// the lexical context is the class, because in this case this is done
// during delayed parsing anyway.
OpenPOWER on IntegriCloud