summaryrefslogtreecommitdiff
path: root/lib/Sema/DeclSpec.cpp
diff options
context:
space:
mode:
authorFaisal Vali <faisalv@yahoo.com>2018-04-26 00:42:40 +0000
committerFaisal Vali <faisalv@yahoo.com>2018-04-26 00:42:40 +0000
commit9626b8d4ee5c7c80e6c3962f224fbe12689de975 (patch)
tree159a319da26a2eaa957679ed371de73c5b777cca /lib/Sema/DeclSpec.cpp
parentc022c7bd3790932b0ddd3d139d484c3b0d5cb554 (diff)
downloadclang-9626b8d4ee5c7c80e6c3962f224fbe12689de975.tar.gz
Revert rC330794 and some dependent tiny bug fixes
See Richard's humbling feedback here: http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20180423/226482.html http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20180423/226486.html Wish I'd had the patience to solicit the feedback prior to committing :) Sorry for the noise guys. Thank you Richard for being the steward that clang deserves! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330888 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/DeclSpec.cpp')
-rw-r--r--lib/Sema/DeclSpec.cpp66
1 files changed, 1 insertions, 65 deletions
diff --git a/lib/Sema/DeclSpec.cpp b/lib/Sema/DeclSpec.cpp
index 5f5d94eee3..2fad5a18ba 100644
--- a/lib/Sema/DeclSpec.cpp
+++ b/lib/Sema/DeclSpec.cpp
@@ -426,7 +426,6 @@ unsigned DeclSpec::getParsedSpecifiers() const {
return Res;
}
-
template <class T> static bool BadSpecifier(T TNew, T TPrev,
const char *&PrevSpec,
unsigned &DiagID,
@@ -492,6 +491,7 @@ const char *DeclSpec::getSpecifierName(TSS S) {
}
llvm_unreachable("Unknown typespec!");
}
+
const char *DeclSpec::getSpecifierName(DeclSpec::TST T,
const PrintingPolicy &Policy) {
switch (T) {
@@ -969,69 +969,6 @@ bool DeclSpec::SetConstexprSpec(SourceLocation Loc, const char *&PrevSpec,
return false;
}
-bool DeclSpec::setConceptSpec(const SourceLocation Loc, const char *&PrevSpec,
- unsigned &DiagID, const PrintingPolicy &PP) {
- assert(Loc.isValid() && "Loc must be valid, since it is used to identify "
- "that this function was called before");
- assert(!ConceptLoc.isValid() &&
- "how is this called if concept was already encountered and triggered "
- "ParseConceptDefinition which parses upto the semi-colon");
-
- PrevSpec = nullptr;
- if (TypeSpecType != TST_unspecified) {
- PrevSpec = DeclSpec::getSpecifierName(static_cast<TST>(TypeSpecType), PP);
- ClearTypeSpecType();
- }
- if (TypeSpecSign != TSS_unspecified) {
- PrevSpec = DeclSpec::getSpecifierName(static_cast<TSS>(TypeSpecSign));
- TypeSpecSign = TSS_unspecified;
- }
- if (TypeSpecWidth != TSW_unspecified) {
- PrevSpec = DeclSpec::getSpecifierName(static_cast<TSW>(TypeSpecWidth));
- TypeSpecWidth = TSW_unspecified;
- }
- if (StorageClassSpec != SCS_unspecified) {
- PrevSpec = DeclSpec::getSpecifierName(static_cast<SCS>(StorageClassSpec));
- ClearStorageClassSpecs();
- }
- if (ThreadStorageClassSpec != TSCS_unspecified) {
- PrevSpec =
- DeclSpec::getSpecifierName(static_cast<TSCS>(ThreadStorageClassSpec));
- ClearStorageClassSpecs();
- }
- if (TypeSpecComplex != TSC_unspecified) {
- PrevSpec = DeclSpec::getSpecifierName(static_cast<TSC>(TypeSpecComplex));
- TypeSpecComplex = TSC_unspecified;
- }
- if (getTypeQualifiers()) {
- PrevSpec = DeclSpec::getSpecifierName(static_cast<TQ>(TypeQualifiers));
- ClearTypeQualifiers();
- }
- if (isFriendSpecified()) {
- PrevSpec = "friend";
- Friend_specified = false;
- FriendLoc = SourceLocation();
- }
- if (isConstexprSpecified()) {
- PrevSpec = "constexpr";
- Constexpr_specified = false;
- ConstexprLoc = SourceLocation();
- }
- if (isInlineSpecified()) {
- PrevSpec = "inline";
- FS_inlineLoc = SourceLocation();
- FS_inline_specified = false;
- }
-
- if (PrevSpec) {
- DiagID = diag::err_invalid_decl_spec_combination;
- }
- // We set the concept location regardless of whether an error occurred.
- DeclRep = nullptr;
- ConceptLoc = Loc;
- return PrevSpec; // If this is non-null, an error occurred.
-}
-
void DeclSpec::SaveWrittenBuiltinSpecs() {
writtenBS.Sign = getTypeSpecSign();
writtenBS.Width = getTypeSpecWidth();
@@ -1333,7 +1270,6 @@ void DeclSpec::Finish(Sema &S, const PrintingPolicy &Policy) {
// TODO: return "auto function" and other bad things based on the real type.
// 'data definition has no type or storage class'?
-
}
bool DeclSpec::isMissingDeclaratorOk() {