summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-03-10 22:18:57 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-03-10 22:18:57 +0000
commit5731c75414b9a01276c50fc02fcdf6ee02f82a43 (patch)
treeac222869c458661a90020bc509d56cc34eef3e16 /clang/lib
parent11d2e1840528ea5e33c655bcb964d404920c47db (diff)
downloadbcm5719-llvm-5731c75414b9a01276c50fc02fcdf6ee02f82a43.tar.gz
bcm5719-llvm-5731c75414b9a01276c50fc02fcdf6ee02f82a43.zip
PR12225: The requirement that literal operators be namespace-scope functions
does not imply that such functions can't be declared at block scope. llvm-svn: 152509
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index a5b74575b6b..29df5c12a60 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -9309,10 +9309,7 @@ bool Sema::CheckOverloadedOperatorDeclaration(FunctionDecl *FnDecl) {
/// of this literal operator function is well-formed. If so, returns
/// false; otherwise, emits appropriate diagnostics and returns true.
bool Sema::CheckLiteralOperatorDeclaration(FunctionDecl *FnDecl) {
- DeclContext *DC = FnDecl->getDeclContext();
- Decl::Kind Kind = DC->getDeclKind();
- if (Kind != Decl::TranslationUnit && Kind != Decl::Namespace &&
- Kind != Decl::LinkageSpec) {
+ if (isa<CXXMethodDecl>(FnDecl)) {
Diag(FnDecl->getLocation(), diag::err_literal_operator_outside_namespace)
<< FnDecl->getDeclName();
return true;
OpenPOWER on IntegriCloud