diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-03-09 08:00:36 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-03-09 08:00:36 +0000 |
commit | 36f5cfe4df32af6c5fe01228102512996f566f9d (patch) | |
tree | 28e2c2562f781f6dbe711d15a00af596b21b9c9b /lib/Sema/SemaDeclCXX.cpp | |
parent | 8a26fc15d4647da863f0cca73a203823b01da7e5 (diff) |
Support for raw and template forms of numeric user-defined literals,
and lots of tidying up.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152392 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 221cc6e53e..4d7310a146 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -9306,9 +9306,15 @@ bool Sema::CheckLiteralOperatorDeclaration(FunctionDecl *FnDecl) { bool Valid = false; + // This might be the definition of a literal operator template. + FunctionTemplateDecl *TpDecl = FnDecl->getDescribedFunctionTemplate(); + // This might be a specialization of a literal operator template. + if (!TpDecl) + TpDecl = FnDecl->getPrimaryTemplate(); + // template <char...> type operator "" name() is the only valid template // signature, and the only valid signature with no parameters. - if (FunctionTemplateDecl *TpDecl = FnDecl->getDescribedFunctionTemplate()) { + if (TpDecl) { if (FnDecl->param_size() == 0) { // Must have only one template parameter TemplateParameterList *Params = TpDecl->getTemplateParameters(); |