//===--- DeclSpec.h - Parsed declaration specifiers -------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines the classes used to store parsed information about
// declaration-specifiers and declarators.
//
// static const int volatile x, *y, *(*(*z)[10])(const void *x);
// ------------------------- - -- ---------------------------
// declaration-specifiers \ | /
// declarators
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_SEMA_DECLSPEC_H
#define LLVM_CLANG_SEMA_DECLSPEC_H
#include "clang/Sema/AttributeList.h"
#include "clang/Sema/Ownership.h"
#include "clang/Lex/Token.h"
#include "clang/Basic/OperatorKinds.h"
#include "clang/Basic/Specifiers.h"
#include "llvm/ADT/SmallVector.h"
namespace clang {
class LangOptions;
class Diagnostic;
class IdentifierInfo;
class NestedNameSpecifier;
class Preprocessor;
class Declarator;
struct TemplateIdAnnotation;
/// CXXScopeSpec - Represents a C++ nested-name-specifier or a global scope
/// specifier. These can be in 3 states:
/// 1) Not present, identified by isEmpty()
/// 2) Present, identified by isNotEmpty()
/// 2.a) Valid, idenified by isValid()
/// 2.b) Invalid, identified by isInvalid().
///
/// isSet() is deprecated because it mostly corresponded to "valid" but was
/// often used as if it meant "present".
///
/// The actual scope is described by getScopeRep().
class CXXScopeSpec {
SourceRange Range;
NestedNameSpecifier *ScopeRep;
public:
CXXScopeSpec() : Range(), ScopeRep() { }
const SourceRange &getRange() const { return Range; }
void setRange(const SourceRange &R) { Range = R; }
void setBeginLoc(SourceLocation Loc) { Range.setBegin(Loc); }
void setEndLoc(SourceLocation Loc) { Range.setEnd(Loc); }
SourceLocation getBeginLoc() const { return Range.getBegin(); }
SourceLocation getEndLoc() const { return Range.getEnd(); }
NestedNameSpecifier *getScopeRep() const { return ScopeRep; }
void setScopeRep(NestedNameSpecifier