git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71936 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Mike Stump 2009-05-16 07:39:55 +00:00
Родитель c6e35aae23
Коммит 390b4cc8b4
17 изменённых файлов: 189 добавлений и 212 удалений

Просмотреть файл

@ -1152,19 +1152,17 @@ static void HandleFormatAttr(Decl *d, const AttributeList &Attr, Sema &S) {
return; return;
} }
} else if (is_NSString) { } else if (is_NSString) {
// FIXME: do we need to check if the type is NSString*? What are // FIXME: do we need to check if the type is NSString*? What are the
// the semantics? // semantics?
if (!isNSStringType(Ty, S.Context)) { if (!isNSStringType(Ty, S.Context)) {
// FIXME: Should highlight the actual expression that has the // FIXME: Should highlight the actual expression that has the wrong type.
// wrong type.
S.Diag(Attr.getLoc(), diag::err_format_attribute_not) S.Diag(Attr.getLoc(), diag::err_format_attribute_not)
<< "an NSString" << IdxExpr->getSourceRange(); << "an NSString" << IdxExpr->getSourceRange();
return; return;
} }
} else if (!Ty->isPointerType() || } else if (!Ty->isPointerType() ||
!Ty->getAsPointerType()->getPointeeType()->isCharType()) { !Ty->getAsPointerType()->getPointeeType()->isCharType()) {
// FIXME: Should highlight the actual expression that has the // FIXME: Should highlight the actual expression that has the wrong type.
// wrong type.
S.Diag(Attr.getLoc(), diag::err_format_attribute_not) S.Diag(Attr.getLoc(), diag::err_format_attribute_not)
<< "a string type" << IdxExpr->getSourceRange(); << "a string type" << IdxExpr->getSourceRange();
return; return;
@ -1418,10 +1416,10 @@ static void HandleModeAttr(Decl *D, const AttributeList &Attr, Sema &S) {
S.Diag(Attr.getLoc(), diag::err_mode_wrong_type); S.Diag(Attr.getLoc(), diag::err_mode_wrong_type);
} }
// FIXME: Sync this with InitializePredefinedMacros; we need to match // FIXME: Sync this with InitializePredefinedMacros; we need to match int8_t
// int8_t and friends, at least with glibc. // and friends, at least with glibc.
// FIXME: Make sure 32/64-bit integers don't get defined to types of // FIXME: Make sure 32/64-bit integers don't get defined to types of the wrong
// the wrong width on unusual platforms. // width on unusual platforms.
// FIXME: Make sure floating-point mappings are accurate // FIXME: Make sure floating-point mappings are accurate
// FIXME: Support XF and TF types // FIXME: Support XF and TF types
QualType NewTy; QualType NewTy;

Просмотреть файл

@ -696,8 +696,8 @@ Sema::ActOnMemInitializer(DeclPtrTy ConstructorD,
} }
// Check for a virtual base class. // Check for a virtual base class.
// FIXME: We might be able to short-circuit this if we know in // FIXME: We might be able to short-circuit this if we know in advance that
// advance that there are no virtual bases. // there are no virtual bases.
const CXXBaseSpecifier *VirtualBaseSpec = 0; const CXXBaseSpecifier *VirtualBaseSpec = 0;
if (!DirectBaseSpec || !DirectBaseSpec->isVirtual()) { if (!DirectBaseSpec || !DirectBaseSpec->isVirtual()) {
// We haven't found a base yet; search the class hierarchy for a // We haven't found a base yet; search the class hierarchy for a
@ -1539,9 +1539,8 @@ Sema::DeclPtrTy Sema::ActOnConversionDeclarator(CXXConversionDecl *Conversion) {
// same object type (or a reference to it), to a (possibly // same object type (or a reference to it), to a (possibly
// cv-qualified) base class of that type (or a reference to it), // cv-qualified) base class of that type (or a reference to it),
// or to (possibly cv-qualified) void. // or to (possibly cv-qualified) void.
// FIXME: Suppress this warning if the conversion function ends up // FIXME: Suppress this warning if the conversion function ends up being a
// being a virtual function that overrides a virtual function in a // virtual function that overrides a virtual function in a base class.
// base class.
QualType ClassType QualType ClassType
= Context.getCanonicalType(Context.getTypeDeclType(ClassDecl)); = Context.getCanonicalType(Context.getTypeDeclType(ClassDecl));
if (const ReferenceType *ConvTypeRef = ConvType->getAsReferenceType()) if (const ReferenceType *ConvTypeRef = ConvType->getAsReferenceType())
@ -1632,9 +1631,9 @@ Sema::DeclPtrTy Sema::ActOnStartNamespaceDef(Scope *NamespcScope,
// Although we could have an invalid decl (i.e. the namespace name is a // Although we could have an invalid decl (i.e. the namespace name is a
// redefinition), push it as current DeclContext and try to continue parsing. // redefinition), push it as current DeclContext and try to continue parsing.
// FIXME: We should be able to push Namespc here, so that the // FIXME: We should be able to push Namespc here, so that the each DeclContext
// each DeclContext for the namespace has the declarations // for the namespace has the declarations that showed up in that particular
// that showed up in that particular namespace definition. // namespace definition.
PushDeclContext(NamespcScope, Namespc); PushDeclContext(NamespcScope, Namespc);
return DeclPtrTy::make(Namespc); return DeclPtrTy::make(Namespc);
} }
@ -2117,8 +2116,8 @@ Sema::CheckReferenceInit(Expr *&Init, QualType DeclType,
return false; return false;
} else { } else {
// Perform the conversion. // Perform the conversion.
// FIXME: Binding to a subobject of the lvalue is going to require // FIXME: Binding to a subobject of the lvalue is going to require more
// more AST annotation than this. // AST annotation than this.
ImpCastExprToType(Init, T1, /*isLvalue=*/true); ImpCastExprToType(Init, T1, /*isLvalue=*/true);
} }
} }
@ -2176,8 +2175,8 @@ Sema::CheckReferenceInit(Expr *&Init, QualType DeclType,
return false; return false;
} else { } else {
// Perform the conversion. // Perform the conversion.
// FIXME: Binding to a subobject of the lvalue is going to require // FIXME: Binding to a subobject of the lvalue is going to require more
// more AST annotation than this. // AST annotation than this.
ImpCastExprToType(Init, T1, /*isLvalue=*/true); ImpCastExprToType(Init, T1, /*isLvalue=*/true);
} }
break; break;
@ -2264,8 +2263,8 @@ Sema::CheckReferenceInit(Expr *&Init, QualType DeclType,
ICS->Standard.RRefBinding = isRValRef; ICS->Standard.RRefBinding = isRValRef;
ICS->Standard.CopyConstructor = 0; ICS->Standard.CopyConstructor = 0;
} else { } else {
// FIXME: Binding to a subobject of the rvalue is going to require // FIXME: Binding to a subobject of the rvalue is going to require more
// more AST annotation than this. // AST annotation than this.
ImpCastExprToType(Init, T1, /*isLvalue=*/true); ImpCastExprToType(Init, T1, /*isLvalue=*/true);
} }
return false; return false;
@ -2349,8 +2348,7 @@ bool Sema::CheckOverloadedOperatorDeclaration(FunctionDecl *FnDecl) {
// described completely in 3.7.3. The attributes and restrictions // described completely in 3.7.3. The attributes and restrictions
// found in the rest of this subclause do not apply to them unless // found in the rest of this subclause do not apply to them unless
// explicitly stated in 3.7.3. // explicitly stated in 3.7.3.
// FIXME: Write a separate routine for checking this. For now, just // FIXME: Write a separate routine for checking this. For now, just allow it.
// allow it.
if (Op == OO_New || Op == OO_Array_New || if (Op == OO_New || Op == OO_Array_New ||
Op == OO_Delete || Op == OO_Array_Delete) Op == OO_Delete || Op == OO_Array_Delete)
return false; return false;
@ -2576,8 +2574,8 @@ Sema::DeclPtrTy Sema::ActOnExceptionDeclarator(Scope *S, Declarator &D) {
AbstractVariableType)) AbstractVariableType))
Invalid = true; Invalid = true;
// FIXME: Need to test for ability to copy-construct and destroy the // FIXME: Need to test for ability to copy-construct and destroy the exception
// exception variable. // variable.
// FIXME: Need to check for abstract classes. // FIXME: Need to check for abstract classes.
IdentifierInfo *II = D.getIdentifier(); IdentifierInfo *II = D.getIdentifier();

Просмотреть файл

@ -667,8 +667,8 @@ Sema::DeclPtrTy Sema::ActOnStartClassImplementation(
// Legacy case of @implementation with no corresponding @interface. // Legacy case of @implementation with no corresponding @interface.
// Build, chain & install the interface decl into the identifier. // Build, chain & install the interface decl into the identifier.
// FIXME: Do we support attributes on the @implementation? If so // FIXME: Do we support attributes on the @implementation? If so we should
// we should copy them over. // copy them over.
IDecl = ObjCInterfaceDecl::Create(Context, CurContext, AtClassImplLoc, IDecl = ObjCInterfaceDecl::Create(Context, CurContext, AtClassImplLoc,
ClassName, ClassLoc, false, true); ClassName, ClassLoc, false, true);
IDecl->setSuperClass(SDecl); IDecl->setSuperClass(SDecl);
@ -851,12 +851,11 @@ bool Sema::isPropertyReadonly(ObjCPropertyDecl *PDecl,
return true; return true;
} }
/// FIXME: Type hierarchies in Objective-C can be deep. We could most /// FIXME: Type hierarchies in Objective-C can be deep. We could most likely
/// likely improve the efficiency of selector lookups and type /// improve the efficiency of selector lookups and type checking by associating
/// checking by associating with each protocol / interface / category /// with each protocol / interface / category the flattened instance tables. If
/// the flattened instance tables. If we used an immutable set to keep /// we used an immutable set to keep the table then it wouldn't add significant
/// the table then it wouldn't add significant memory cost and it /// memory cost and it would be handy for lookups.
/// would be handy for lookups.
/// CheckProtocolMethodDefs - This routine checks unimplemented methods /// CheckProtocolMethodDefs - This routine checks unimplemented methods
/// Declared in protocol, and those referenced by it. /// Declared in protocol, and those referenced by it.
@ -1353,11 +1352,10 @@ void Sema::ProcessPropertyDecl(ObjCPropertyDecl *property,
// Synthesize getter/setter methods if none exist. // Synthesize getter/setter methods if none exist.
// Find the default getter and if one not found, add one. // Find the default getter and if one not found, add one.
// FIXME: The synthesized property we set here is misleading. We // FIXME: The synthesized property we set here is misleading. We almost always
// almost always synthesize these methods unless the user explicitly // synthesize these methods unless the user explicitly provided prototypes
// provided prototypes (which is odd, but allowed). Sema should be // (which is odd, but allowed). Sema should be typechecking that the
// typechecking that the declarations jive in that situation (which // declarations jive in that situation (which it is not currently).
// it is not currently).
if (!GetterMethod) { if (!GetterMethod) {
// No instance method of same name as property getter name was found. // No instance method of same name as property getter name was found.
// Declare a getter method and add it to the list of methods // Declare a getter method and add it to the list of methods

Просмотреть файл

@ -101,9 +101,8 @@ void Sema::DiagnoseSentinelCalls(NamedDecl *D, SourceLocation Loc,
int sentinelPos = attr->getSentinel(); int sentinelPos = attr->getSentinel();
int nullPos = attr->getNullPos(); int nullPos = attr->getNullPos();
// FIXME. ObjCMethodDecl and FunctionDecl need be derived from the // FIXME. ObjCMethodDecl and FunctionDecl need be derived from the same common
// same common base class. Then we won't be needing two versions of // base class. Then we won't be needing two versions of the same code.
// the same code.
unsigned int i = 0; unsigned int i = 0;
bool warnNotEnoughArgs = false; bool warnNotEnoughArgs = false;
int isMethod = 0; int isMethod = 0;
@ -644,10 +643,9 @@ static Decl *getObjectForAnonymousRecordDecl(ASTContext &Context,
assert(Record->isAnonymousStructOrUnion() && assert(Record->isAnonymousStructOrUnion() &&
"Record must be an anonymous struct or union!"); "Record must be an anonymous struct or union!");
// FIXME: Once Decls are directly linked together, this will // FIXME: Once Decls are directly linked together, this will be an O(1)
// be an O(1) operation rather than a slow walk through DeclContext's // operation rather than a slow walk through DeclContext's vector (which
// vector (which itself will be eliminated). DeclGroups might make // itself will be eliminated). DeclGroups might make this even better.
// this even better.
DeclContext *Ctx = Record->getDeclContext(); DeclContext *Ctx = Record->getDeclContext();
for (DeclContext::decl_iterator D = Ctx->decls_begin(Context), for (DeclContext::decl_iterator D = Ctx->decls_begin(Context),
DEnd = Ctx->decls_end(Context); DEnd = Ctx->decls_end(Context);
@ -873,8 +871,8 @@ Sema::ActOnDeclarationNameExpr(Scope *S, SourceLocation Loc,
if (IV->getAccessControl() == ObjCIvarDecl::Private && if (IV->getAccessControl() == ObjCIvarDecl::Private &&
ClassDeclared != IFace) ClassDeclared != IFace)
Diag(Loc, diag::error_private_ivar_access) << IV->getDeclName(); Diag(Loc, diag::error_private_ivar_access) << IV->getDeclName();
// FIXME: This should use a new expr for a direct reference, don't turn // FIXME: This should use a new expr for a direct reference, don't
// this into Self->ivar, just return a BareIVarExpr or something. // turn this into Self->ivar, just return a BareIVarExpr or something.
IdentifierInfo &II = Context.Idents.get("self"); IdentifierInfo &II = Context.Idents.get("self");
OwningExprResult SelfExpr = ActOnIdentifierExpr(S, Loc, II, false); OwningExprResult SelfExpr = ActOnIdentifierExpr(S, Loc, II, false);
return Owned(new (Context) return Owned(new (Context)
@ -2059,8 +2057,7 @@ Sema::ActOnMemberReferenceExpr(Scope *S, ExprArg Base, SourceLocation OpLoc,
return ExprError(); return ExprError();
// The record definition is complete, now make sure the member is valid. // The record definition is complete, now make sure the member is valid.
// FIXME: Qualified name lookup for C++ is a bit more complicated // FIXME: Qualified name lookup for C++ is a bit more complicated than this.
// than this.
LookupResult Result LookupResult Result
= LookupQualifiedName(RDecl, DeclarationName(&Member), = LookupQualifiedName(RDecl, DeclarationName(&Member),
LookupMemberName, false); LookupMemberName, false);
@ -2161,10 +2158,10 @@ Sema::ActOnMemberReferenceExpr(Scope *S, ExprArg Base, SourceLocation OpLoc,
else if (ObjCImpDecl && getCurFunctionDecl()) { else if (ObjCImpDecl && getCurFunctionDecl()) {
// Case of a c-function declared inside an objc implementation. // Case of a c-function declared inside an objc implementation.
// FIXME: For a c-style function nested inside an objc implementation // FIXME: For a c-style function nested inside an objc implementation
// class, there is no implementation context available, so we pass down // class, there is no implementation context available, so we pass
// the context as argument to this routine. Ideally, this context need // down the context as argument to this routine. Ideally, this context
// be passed down in the AST node and somehow calculated from the AST // need be passed down in the AST node and somehow calculated from the
// for a function decl. // AST for a function decl.
Decl *ImplDecl = ObjCImpDecl.getAs<Decl>(); Decl *ImplDecl = ObjCImpDecl.getAs<Decl>();
if (ObjCImplementationDecl *IMPD = if (ObjCImplementationDecl *IMPD =
dyn_cast<ObjCImplementationDecl>(ImplDecl)) dyn_cast<ObjCImplementationDecl>(ImplDecl))
@ -2510,7 +2507,8 @@ Sema::ActOnCallExpr(Scope *S, ExprArg fn, SourceLocation LParenLoc,
if (getLangOptions().CPlusPlus) { if (getLangOptions().CPlusPlus) {
// Determine whether this is a dependent call inside a C++ template, // Determine whether this is a dependent call inside a C++ template,
// in which case we won't do any semantic analysis now. // in which case we won't do any semantic analysis now.
// FIXME: Will need to cache the results of name lookup (including ADL) in Fn. // FIXME: Will need to cache the results of name lookup (including ADL) in
// Fn.
bool Dependent = false; bool Dependent = false;
if (Fn->isTypeDependent()) if (Fn->isTypeDependent())
Dependent = true; Dependent = true;
@ -3043,9 +3041,10 @@ QualType Sema::CheckConditionalOperands(Expr *&Cond, Expr *&LHS, Expr *&RHS,
Context.isObjCObjectPointerType(RHSTy)) || Context.isObjCObjectPointerType(RHSTy)) ||
(RHSTy->isObjCQualifiedIdType() && (RHSTy->isObjCQualifiedIdType() &&
Context.isObjCObjectPointerType(LHSTy))) { Context.isObjCObjectPointerType(LHSTy))) {
// FIXME: This is not the correct composite type. This only // FIXME: This is not the correct composite type. This only happens to
// happens to work because id can more or less be used anywhere, // work because id can more or less be used anywhere, however this may
// however this may change the type of method sends. // change the type of method sends.
// FIXME: gcc adds some type-checking of the arguments and emits // FIXME: gcc adds some type-checking of the arguments and emits
// (confusing) incompatible comparison warnings in some // (confusing) incompatible comparison warnings in some
// cases. Investigate. // cases. Investigate.
@ -4351,8 +4350,8 @@ static NamedDecl *getPrimaryDecl(Expr *E) {
// Otherwise, the expression refers to a part of the base // Otherwise, the expression refers to a part of the base
return getPrimaryDecl(cast<MemberExpr>(E)->getBase()); return getPrimaryDecl(cast<MemberExpr>(E)->getBase());
case Stmt::ArraySubscriptExprClass: { case Stmt::ArraySubscriptExprClass: {
// FIXME: This code shouldn't be necessary! We should catch the // FIXME: This code shouldn't be necessary! We should catch the implicit
// implicit promotion of register arrays earlier. // promotion of register arrays earlier.
Expr* Base = cast<ArraySubscriptExpr>(E)->getBase(); Expr* Base = cast<ArraySubscriptExpr>(E)->getBase();
if (ImplicitCastExpr* ICE = dyn_cast<ImplicitCastExpr>(Base)) { if (ImplicitCastExpr* ICE = dyn_cast<ImplicitCastExpr>(Base)) {
if (ICE->getSubExpr()->getType()->isArrayType()) if (ICE->getSubExpr()->getType()->isArrayType())
@ -4705,8 +4704,7 @@ Action::OwningExprResult Sema::CreateBuiltinUnaryOp(SourceLocation OpLoc,
ExprArg InputArg) { ExprArg InputArg) {
UnaryOperator::Opcode Opc = static_cast<UnaryOperator::Opcode>(OpcIn); UnaryOperator::Opcode Opc = static_cast<UnaryOperator::Opcode>(OpcIn);
// FIXME: Input is modified below, but InputArg is not updated // FIXME: Input is modified below, but InputArg is not updated appropriately.
// appropriately.
Expr *Input = (Expr *)InputArg.get(); Expr *Input = (Expr *)InputArg.get();
QualType resultType; QualType resultType;
switch (Opc) { switch (Opc) {

Просмотреть файл

@ -813,9 +813,9 @@ Sema::PerformImplicitConversion(Expr *&From, QualType ToType,
break; break;
case ImplicitConversionSequence::UserDefinedConversion: case ImplicitConversionSequence::UserDefinedConversion:
// FIXME: This is, of course, wrong. We'll need to actually call // FIXME: This is, of course, wrong. We'll need to actually call the
// the constructor or conversion operator, and then cope with the // constructor or conversion operator, and then cope with the standard
// standard conversions. // conversions.
ImpCastExprToType(From, ToType.getNonReferenceType(), ImpCastExprToType(From, ToType.getNonReferenceType(),
ToType->isLValueReferenceType()); ToType->isLValueReferenceType());
return false; return false;
@ -842,16 +842,14 @@ bool
Sema::PerformImplicitConversion(Expr *&From, QualType ToType, Sema::PerformImplicitConversion(Expr *&From, QualType ToType,
const StandardConversionSequence& SCS, const StandardConversionSequence& SCS,
const char *Flavor) { const char *Flavor) {
// Overall FIXME: we are recomputing too many types here and doing // Overall FIXME: we are recomputing too many types here and doing far too
// far too much extra work. What this means is that we need to keep // much extra work. What this means is that we need to keep track of more
// track of more information that is computed when we try the // information that is computed when we try the implicit conversion initially,
// implicit conversion initially, so that we don't need to recompute // so that we don't need to recompute anything here.
// anything here.
QualType FromType = From->getType(); QualType FromType = From->getType();
if (SCS.CopyConstructor) { if (SCS.CopyConstructor) {
// FIXME: Create a temporary object by calling the copy // FIXME: Create a temporary object by calling the copy constructor.
// constructor.
ImpCastExprToType(From, ToType.getNonReferenceType(), ImpCastExprToType(From, ToType.getNonReferenceType(),
ToType->isLValueReferenceType()); ToType->isLValueReferenceType());
return false; return false;
@ -946,8 +944,8 @@ Sema::PerformImplicitConversion(Expr *&From, QualType ToType,
break; break;
case ICK_Qualification: case ICK_Qualification:
// FIXME: Not sure about lvalue vs rvalue here in the presence of // FIXME: Not sure about lvalue vs rvalue here in the presence of rvalue
// rvalue references. // references.
ImpCastExprToType(From, ToType.getNonReferenceType(), ImpCastExprToType(From, ToType.getNonReferenceType(),
ToType->isLValueReferenceType()); ToType->isLValueReferenceType());
break; break;
@ -966,9 +964,9 @@ Sema::OwningExprResult Sema::ActOnUnaryTypeTrait(UnaryTypeTrait OTT,
TypeTy *Ty, TypeTy *Ty,
SourceLocation RParen) { SourceLocation RParen) {
// FIXME: Some of the type traits have requirements. Interestingly, only the // FIXME: Some of the type traits have requirements. Interestingly, only the
// __is_base_of requirement is explicitly stated to be diagnosed. Indeed, // __is_base_of requirement is explicitly stated to be diagnosed. Indeed, G++
// G++ accepts __is_pod(Incomplete) without complaints, and claims that the // accepts __is_pod(Incomplete) without complaints, and claims that the type
// type is indeed a POD. // is indeed a POD.
// There is no point in eagerly computing the value. The traits are designed // There is no point in eagerly computing the value. The traits are designed
// to be used from type trait templates, so Ty will be a template parameter // to be used from type trait templates, so Ty will be a template parameter
@ -1015,8 +1013,8 @@ QualType Sema::CheckPointerToMemberOperands(
Context.getCanonicalType(LType).getUnqualifiedType()) { Context.getCanonicalType(LType).getUnqualifiedType()) {
BasePaths Paths(/*FindAmbiguities=*/true, /*RecordPaths=*/false, BasePaths Paths(/*FindAmbiguities=*/true, /*RecordPaths=*/false,
/*DetectVirtual=*/false); /*DetectVirtual=*/false);
// FIXME: Would it be useful to print full ambiguity paths, // FIXME: Would it be useful to print full ambiguity paths, or is that
// or is that overkill? // overkill?
if (!IsDerivedFrom(LType, Class, Paths) || if (!IsDerivedFrom(LType, Class, Paths) ||
Paths.isAmbiguous(Context.getCanonicalType(Class))) { Paths.isAmbiguous(Context.getCanonicalType(Class))) {
Diag(Loc, diag::err_bad_memptr_lhs) << OpSpelling Diag(Loc, diag::err_bad_memptr_lhs) << OpSpelling
@ -1032,9 +1030,9 @@ QualType Sema::CheckPointerToMemberOperands(
// in accordance with 5.5p5 and 5.2.5. // in accordance with 5.5p5 and 5.2.5.
// FIXME: This returns a dereferenced member function pointer as a normal // FIXME: This returns a dereferenced member function pointer as a normal
// function type. However, the only operation valid on such functions is // function type. However, the only operation valid on such functions is
// calling them. There's also a GCC extension to get a function pointer to // calling them. There's also a GCC extension to get a function pointer to the
// the thing, which is another complication, because this type - unlike the // thing, which is another complication, because this type - unlike the type
// type that is the result of this expression - takes the class as the first // that is the result of this expression - takes the class as the first
// argument. // argument.
// We probably need a "MemberFunctionClosureType" or something like that. // We probably need a "MemberFunctionClosureType" or something like that.
QualType Result = MemPtr->getPointeeType(); QualType Result = MemPtr->getPointeeType();
@ -1162,8 +1160,8 @@ static bool FindConditionalOverload(Sema &Self, Expr *&LHS, Expr *&RHS,
Self.Diag(Loc, diag::err_conditional_ambiguous_ovl) Self.Diag(Loc, diag::err_conditional_ambiguous_ovl)
<< LHS->getType() << RHS->getType() << LHS->getType() << RHS->getType()
<< LHS->getSourceRange() << RHS->getSourceRange(); << LHS->getSourceRange() << RHS->getSourceRange();
// FIXME: Print the possible common types by printing the return types // FIXME: Print the possible common types by printing the return types of
// of the viable candidates. // the viable candidates.
break; break;
case Sema::OR_Deleted: case Sema::OR_Deleted:
@ -1210,8 +1208,8 @@ static bool ConvertForConditional(Sema &Self, Expr *&E,
/// extension. In this case, LHS == Cond. (But they're not aliases.) /// extension. In this case, LHS == Cond. (But they're not aliases.)
QualType Sema::CXXCheckConditionalOperands(Expr *&Cond, Expr *&LHS, Expr *&RHS, QualType Sema::CXXCheckConditionalOperands(Expr *&Cond, Expr *&LHS, Expr *&RHS,
SourceLocation QuestionLoc) { SourceLocation QuestionLoc) {
// FIXME: Handle C99's complex types, vector types, block pointers and // FIXME: Handle C99's complex types, vector types, block pointers and Obj-C++
// Obj-C++ interface pointers. // interface pointers.
// C++0x 5.16p1 // C++0x 5.16p1
// The first expression is contextually converted to bool. // The first expression is contextually converted to bool.

Просмотреть файл

@ -444,12 +444,12 @@ Sema::ExprResult Sema::ActOnClassMessage(
lbrac, rbrac, returnType)) lbrac, rbrac, returnType))
return true; return true;
// If we have the ObjCInterfaceDecl* for the class that is receiving // If we have the ObjCInterfaceDecl* for the class that is receiving the
// the message, use that to construct the ObjCMessageExpr. Otherwise // message, use that to construct the ObjCMessageExpr. Otherwise pass on the
// pass on the IdentifierInfo* for the class. // IdentifierInfo* for the class.
// FIXME: need to do a better job handling 'super' usage within a class // FIXME: need to do a better job handling 'super' usage within a class. For
// For now, we simply pass the "super" identifier through (which isn't // now, we simply pass the "super" identifier through (which isn't consistent
// consistent with instance methods. // with instance methods.
if (isSuper) if (isSuper)
return new (Context) ObjCMessageExpr(receiverName, Sel, returnType, Method, return new (Context) ObjCMessageExpr(receiverName, Sel, returnType, Method,
lbrac, rbrac, ArgExprs, NumArgs); lbrac, rbrac, ArgExprs, NumArgs);
@ -580,7 +580,7 @@ Sema::ExprResult Sema::ActOnInstanceMessage(ExprTy *receiver, Selector Sel,
ClassDecl = OCIType->getDecl(); ClassDecl = OCIType->getDecl();
// FIXME: consider using LookupInstanceMethodInGlobalPool, since it will be // FIXME: consider using LookupInstanceMethodInGlobalPool, since it will be
// faster than the following method (which can do *many* linear searches). // faster than the following method (which can do *many* linear searches).
// The idea is to add class info to InstanceMethodPool. // The idea is to add class info to InstanceMethodPool.
Method = ClassDecl->lookupInstanceMethod(Context, Sel); Method = ClassDecl->lookupInstanceMethod(Context, Sel);
@ -668,12 +668,12 @@ static bool ClassImplementsProtocol(ObjCProtocolDecl *lProto,
E = Protocols.end(); PI != E; ++PI) { E = Protocols.end(); PI != E; ++PI) {
if (ProtocolCompatibleWithProtocol(lProto, *PI)) if (ProtocolCompatibleWithProtocol(lProto, *PI))
return true; return true;
// This is dubious and is added to be compatible with gcc. // This is dubious and is added to be compatible with gcc. In gcc, it is
// In gcc, it is also allowed assigning a protocol-qualified 'id' // also allowed assigning a protocol-qualified 'id' type to a LHS object
// type to a LHS object when protocol in qualified LHS is in list // when protocol in qualified LHS is in list of protocols in the rhs 'id'
// of protocols in the rhs 'id' object. This IMO, should be a bug. // object. This IMO, should be a bug.
// FIXME: Treat this as an extension, and flag this as an error when // FIXME: Treat this as an extension, and flag this as an error when GCC
// GCC extensions are not enabled. // extensions are not enabled.
if (RHSIsQualifiedID && ProtocolCompatibleWithProtocol(*PI, lProto)) if (RHSIsQualifiedID && ProtocolCompatibleWithProtocol(*PI, lProto))
return true; return true;
} }

Просмотреть файл

@ -174,8 +174,8 @@ bool Sema::CheckInitializerTypes(Expr *&Init, QualType &DeclType,
// expression as its argument; if the function is a // expression as its argument; if the function is a
// constructor, the call initializes a temporary of the // constructor, the call initializes a temporary of the
// destination type. // destination type.
// FIXME: We're pretending to do copy elision here; return to // FIXME: We're pretending to do copy elision here; return to this when we
// this when we have ASTs for such things. // have ASTs for such things.
if (!PerformImplicitConversion(Init, DeclType, "initializing")) if (!PerformImplicitConversion(Init, DeclType, "initializing"))
return false; return false;
@ -349,10 +349,9 @@ void InitListChecker::FillInValueInitializations(InitListExpr *ILE) {
return; return;
} }
// FIXME: If value-initialization involves calling a // FIXME: If value-initialization involves calling a constructor, should
// constructor, should we make that call explicit in the // we make that call explicit in the representation (even when it means
// representation (even when it means extending the // extending the initializer list)?
// initializer list)?
if (Init < NumInits && !hadError) if (Init < NumInits && !hadError)
ILE->setInit(Init, ILE->setInit(Init,
new (SemaRef.Context) ImplicitValueInitExpr(Field->getType())); new (SemaRef.Context) ImplicitValueInitExpr(Field->getType()));
@ -390,10 +389,9 @@ void InitListChecker::FillInValueInitializations(InitListExpr *ILE) {
return; return;
} }
// FIXME: If value-initialization involves calling a // FIXME: If value-initialization involves calling a constructor, should
// constructor, should we make that call explicit in the // we make that call explicit in the representation (even when it means
// representation (even when it means extending the // extending the initializer list)?
// initializer list)?
if (Init < NumInits && !hadError) if (Init < NumInits && !hadError)
ILE->setInit(Init, ILE->setInit(Init,
new (SemaRef.Context) ImplicitValueInitExpr(ElementType)); new (SemaRef.Context) ImplicitValueInitExpr(ElementType));
@ -761,10 +759,10 @@ void InitListChecker::CheckReferenceType(InitListExpr *IList, QualType DeclType,
UpdateStructuredListElement(StructuredList, StructuredIndex, expr); UpdateStructuredListElement(StructuredList, StructuredIndex, expr);
++Index; ++Index;
} else { } else {
// FIXME: It would be wonderful if we could point at the actual // FIXME: It would be wonderful if we could point at the actual member. In
// member. In general, it would be useful to pass location // general, it would be useful to pass location information down the stack,
// information down the stack, so that we know the location (or // so that we know the location (or decl) of the "current object" being
// decl) of the "current object" being initialized. // initialized.
SemaRef.Diag(IList->getLocStart(), SemaRef.Diag(IList->getLocStart(),
diag::err_init_reference_member_uninitialized) diag::err_init_reference_member_uninitialized)
<< DeclType << DeclType
@ -1733,8 +1731,8 @@ bool Sema::CheckValueInitialization(QualType Type, SourceLocation Loc) {
// called (and the initialization is ill-formed if T has no // called (and the initialization is ill-formed if T has no
// accessible default constructor); // accessible default constructor);
if (ClassDecl->hasUserDeclaredConstructor()) if (ClassDecl->hasUserDeclaredConstructor())
// FIXME: Eventually, we'll need to put the constructor decl // FIXME: Eventually, we'll need to put the constructor decl into the
// into the AST. // AST.
return PerformInitializationByConstructor(Type, 0, 0, Loc, return PerformInitializationByConstructor(Type, 0, 0, Loc,
SourceRange(Loc), SourceRange(Loc),
DeclarationName(), DeclarationName(),
@ -1747,8 +1745,8 @@ bool Sema::CheckValueInitialization(QualType Type, SourceLocation Loc) {
// [...] A program that calls for default-initialization or // [...] A program that calls for default-initialization or
// value-initialization of an entity of reference type is // value-initialization of an entity of reference type is
// ill-formed. [...] // ill-formed. [...]
// FIXME: Once we have code that goes through this path, add an // FIXME: Once we have code that goes through this path, add an actual
// actual diagnostic :) // diagnostic :)
} }
return false; return false;

Просмотреть файл

@ -131,9 +131,9 @@ MaybeConstructOverloadSet(ASTContext &Context,
OverloadedFunctionDecl *Ovl = 0; OverloadedFunctionDecl *Ovl = 0;
for (++Last; Last != IEnd && isa<FunctionDecl>(*Last); ++Last) { for (++Last; Last != IEnd && isa<FunctionDecl>(*Last); ++Last) {
if (!Ovl) { if (!Ovl) {
// FIXME: We leak this overload set. Eventually, we want to // FIXME: We leak this overload set. Eventually, we want to stop
// stop building the declarations for these overload sets, so // building the declarations for these overload sets, so there will be
// there will be nothing to leak. // nothing to leak.
Ovl = OverloadedFunctionDecl::Create(Context, (*I)->getDeclContext(), Ovl = OverloadedFunctionDecl::Create(Context, (*I)->getDeclContext(),
(*I)->getDeclName()); (*I)->getDeclName());
Ovl->addOverload(cast<FunctionDecl>(*I)); Ovl->addOverload(cast<FunctionDecl>(*I));
@ -677,12 +677,11 @@ Sema::CppLookupName(Scope *S, DeclarationName Name,
if (DeclContext *Ctx = static_cast<DeclContext*>(S->getEntity())) { if (DeclContext *Ctx = static_cast<DeclContext*>(S->getEntity())) {
LookupResult R; LookupResult R;
// Perform member lookup into struct. // Perform member lookup into struct.
// FIXME: In some cases, we know that every name that could be // FIXME: In some cases, we know that every name that could be found by
// found by this qualified name lookup will also be on the // this qualified name lookup will also be on the identifier chain. For
// identifier chain. For example, inside a class without any // example, inside a class without any base classes, we never need to
// base classes, we never need to perform qualified lookup // perform qualified lookup because all of the members are on top of the
// because all of the members are on top of the identifier // identifier chain.
// chain.
if (isa<RecordDecl>(Ctx)) { if (isa<RecordDecl>(Ctx)) {
R = LookupQualifiedName(Ctx, Name, NameKind, RedeclarationOnly); R = LookupQualifiedName(Ctx, Name, NameKind, RedeclarationOnly);
if (R || RedeclarationOnly) if (R || RedeclarationOnly)
@ -705,10 +704,9 @@ Sema::CppLookupName(Scope *S, DeclarationName Name,
// Collect UsingDirectiveDecls in all scopes, and recursively all // Collect UsingDirectiveDecls in all scopes, and recursively all
// nominated namespaces by those using-directives. // nominated namespaces by those using-directives.
// UsingDirectives are pushed to heap, in common ancestor pointer // UsingDirectives are pushed to heap, in common ancestor pointer value order.
// value order. // FIXME: Cache this sorted list in Scope structure, and DeclContext, so we
// FIXME: Cache this sorted list in Scope structure, and DeclContext, // don't build it for each lookup!
// so we don't build it for each lookup!
UsingDirectivesTy UDirs; UsingDirectivesTy UDirs;
for (Scope *SC = Initial; SC; SC = SC->getParent()) for (Scope *SC = Initial; SC; SC = SC->getParent())
if (SC->getFlags() & Scope::DeclScope) if (SC->getFlags() & Scope::DeclScope)

Просмотреть файл

@ -548,9 +548,9 @@ CheckStaticCast(Sema &Self, Expr *&SrcExpr, QualType DestType,
} }
// We tried everything. Everything! Nothing works! :-( // We tried everything. Everything! Nothing works! :-(
// FIXME: Error reporting could be a lot better. Should store the reason // FIXME: Error reporting could be a lot better. Should store the reason why
// why every substep failed and, at the end, select the most specific and // every substep failed and, at the end, select the most specific and report
// report that. // that.
Self.Diag(OpRange.getBegin(), diag::err_bad_cxx_cast_generic) Self.Diag(OpRange.getBegin(), diag::err_bad_cxx_cast_generic)
<< "static_cast" << DestType << OrigSrcType << "static_cast" << DestType << OrigSrcType
<< OpRange; << OpRange;

Просмотреть файл

@ -745,8 +745,8 @@ bool Sema::IsIntegralPromotion(Expr *From, QualType FromType, QualType ToType)
// the bit-field is larger yet, no integral promotion applies to // the bit-field is larger yet, no integral promotion applies to
// it. If the bit-field has an enumerated type, it is treated as any // it. If the bit-field has an enumerated type, it is treated as any
// other value of that type for promotion purposes (C++ 4.5p3). // other value of that type for promotion purposes (C++ 4.5p3).
// FIXME: We should delay checking of bit-fields until we actually // FIXME: We should delay checking of bit-fields until we actually perform the
// perform the conversion. // conversion.
using llvm::APSInt; using llvm::APSInt;
if (From) if (From)
if (FieldDecl *MemberDecl = From->getBitField()) { if (FieldDecl *MemberDecl = From->getBitField()) {
@ -1141,8 +1141,8 @@ bool Sema::CheckPointerConversion(Expr *From, QualType ToType) {
ToPointeeType = ToPtrType->getPointeeType(); ToPointeeType = ToPtrType->getPointeeType();
// Objective-C++ conversions are always okay. // Objective-C++ conversions are always okay.
// FIXME: We should have a different class of conversions for // FIXME: We should have a different class of conversions for the
// the Objective-C++ implicit conversions. // Objective-C++ implicit conversions.
if (Context.isObjCIdStructType(FromPointeeType) || if (Context.isObjCIdStructType(FromPointeeType) ||
Context.isObjCIdStructType(ToPointeeType) || Context.isObjCIdStructType(ToPointeeType) ||
Context.isObjCClassStructType(FromPointeeType) || Context.isObjCClassStructType(FromPointeeType) ||
@ -2385,9 +2385,9 @@ void Sema::AddSurrogateCandidate(CXXConversionDecl *Conversion,
} }
} }
// FIXME: This will eventually be removed, once we've migrated all of // FIXME: This will eventually be removed, once we've migrated all of the
// the operator overloading logic over to the scheme used by binary // operator overloading logic over to the scheme used by binary operators, which
// operators, which works for template instantiation. // works for template instantiation.
void Sema::AddOperatorCandidates(OverloadedOperatorKind Op, Scope *S, void Sema::AddOperatorCandidates(OverloadedOperatorKind Op, Scope *S,
SourceLocation OpLoc, SourceLocation OpLoc,
Expr **Args, unsigned NumArgs, Expr **Args, unsigned NumArgs,
@ -2580,8 +2580,8 @@ BuiltinCandidateTypeSet::AddPointerWithMoreQualifiedTypeVariants(QualType Ty) {
QualType PointeeTy = PointerTy->getPointeeType(); QualType PointeeTy = PointerTy->getPointeeType();
// FIXME: Optimize this so that we don't keep trying to add the same types. // FIXME: Optimize this so that we don't keep trying to add the same types.
// FIXME: Do we have to add CVR qualifiers at *all* levels to deal // FIXME: Do we have to add CVR qualifiers at *all* levels to deal with all
// with all pointer conversions that don't cast away constness? // pointer conversions that don't cast away constness?
if (!PointeeTy.isConstQualified()) if (!PointeeTy.isConstQualified())
AddPointerWithMoreQualifiedTypeVariants AddPointerWithMoreQualifiedTypeVariants
(Context.getPointerType(PointeeTy.withConst())); (Context.getPointerType(PointeeTy.withConst()));
@ -3546,8 +3546,8 @@ Sema::PrintOverloadCandidates(OverloadCandidateSet& CandidateSet,
<< FnType; << FnType;
} else { } else {
// FIXME: We need to get the identifier in here // FIXME: We need to get the identifier in here
// FIXME: Do we want the error message to point at the // FIXME: Do we want the error message to point at the operator?
// operator? (built-ins won't have a location) // (built-ins won't have a location)
QualType FnType QualType FnType
= Context.getFunctionType(Cand->BuiltinTypes.ResultTy, = Context.getFunctionType(Cand->BuiltinTypes.ResultTy,
Cand->BuiltinTypes.ParamTypes, Cand->BuiltinTypes.ParamTypes,

Просмотреть файл

@ -380,9 +380,9 @@ Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, StmtArg Switch,
Diag(TheDefaultStmt->getDefaultLoc(), diag::note_duplicate_case_prev); Diag(TheDefaultStmt->getDefaultLoc(), diag::note_duplicate_case_prev);
// FIXME: Remove the default statement from the switch block so that // FIXME: Remove the default statement from the switch block so that
// we'll return a valid AST. This requires recursing down the // we'll return a valid AST. This requires recursing down the AST and
// AST and finding it, not something we are set up to do right now. For // finding it, not something we are set up to do right now. For now,
// now, just lop the entire switch stmt out of the AST. // just lop the entire switch stmt out of the AST.
CaseListIsErroneous = true; CaseListIsErroneous = true;
} }
TheDefaultStmt = DS; TheDefaultStmt = DS;
@ -436,8 +436,8 @@ Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, StmtArg Switch,
diag::err_duplicate_case) << CaseVals[i].first.toString(10); diag::err_duplicate_case) << CaseVals[i].first.toString(10);
Diag(CaseVals[i].second->getLHS()->getLocStart(), Diag(CaseVals[i].second->getLHS()->getLocStart(),
diag::note_duplicate_case_prev); diag::note_duplicate_case_prev);
// FIXME: We really want to remove the bogus case stmt from // FIXME: We really want to remove the bogus case stmt from the
// the substmt, but we have no way to do this right now. // substmt, but we have no way to do this right now.
CaseListIsErroneous = true; CaseListIsErroneous = true;
} }
} }
@ -522,17 +522,16 @@ Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, StmtArg Switch,
<< OverlapVal.toString(10); << OverlapVal.toString(10);
Diag(OverlapStmt->getLHS()->getLocStart(), Diag(OverlapStmt->getLHS()->getLocStart(),
diag::note_duplicate_case_prev); diag::note_duplicate_case_prev);
// FIXME: We really want to remove the bogus case stmt from // FIXME: We really want to remove the bogus case stmt from the
// the substmt, but we have no way to do this right now. // substmt, but we have no way to do this right now.
CaseListIsErroneous = true; CaseListIsErroneous = true;
} }
} }
} }
} }
// FIXME: If the case list was broken is some way, we don't have a // FIXME: If the case list was broken is some way, we don't have a good system
// good system to patch it up. Instead, just return the whole // to patch it up. Instead, just return the whole substmt as broken.
// substmt as broken.
if (CaseListIsErroneous) if (CaseListIsErroneous)
return StmtError(); return StmtError();

Просмотреть файл

@ -436,8 +436,7 @@ Sema::ActOnClassTemplate(Scope *S, unsigned TagSpec, TagKind TK,
if (SS.isNotEmpty() && !SS.isInvalid()) { if (SS.isNotEmpty() && !SS.isInvalid()) {
SemanticContext = computeDeclContext(SS); SemanticContext = computeDeclContext(SS);
// FIXME: need to match up several levels of template parameter // FIXME: need to match up several levels of template parameter lists here.
// lists here.
} }
// FIXME: member templates! // FIXME: member templates!
@ -668,9 +667,8 @@ bool Sema::CheckTemplateParameterList(TemplateParameterList *NewParams,
// Merge the default argument from the old declaration to the // Merge the default argument from the old declaration to the
// new declaration. // new declaration.
SawDefaultArgument = true; SawDefaultArgument = true;
// FIXME: We need to create a new kind of "default argument" // FIXME: We need to create a new kind of "default argument" expression
// expression that points to a previous template template // that points to a previous template template parameter.
// parameter.
NewTemplateParm->setDefaultArgument( NewTemplateParm->setDefaultArgument(
OldTemplateParm->getDefaultArgument()); OldTemplateParm->getDefaultArgument());
PreviousDefaultArgLoc = OldTemplateParm->getDefaultArgumentLoc(); PreviousDefaultArgLoc = OldTemplateParm->getDefaultArgumentLoc();
@ -1802,12 +1800,11 @@ Sema::TemplateParameterListsAreEqual(TemplateParameterList *New,
// Okay; all template type parameters are equivalent (since we // Okay; all template type parameters are equivalent (since we
// know we're at the same index). // know we're at the same index).
#if 0 #if 0
// FIXME: Enable this code in debug mode *after* we properly go // FIXME: Enable this code in debug mode *after* we properly go through
// through and "instantiate" the template parameter lists of // and "instantiate" the template parameter lists of template template
// template template parameters. It's only after this // parameters. It's only after this instantiation that (1) any dependent
// instantiation that (1) any dependent types within the // types within the template parameter list of the template template
// template parameter list of the template template parameter // parameter can be checked, and (2) the template type parameter depths
// can be checked, and (2) the template type parameter depths
// will match up. // will match up.
QualType OldParmType QualType OldParmType
= Context.getTypeDeclType(cast<TemplateTypeParmDecl>(*OldParm)); = Context.getTypeDeclType(cast<TemplateTypeParmDecl>(*OldParm));
@ -1960,8 +1957,8 @@ Sema::CheckClassTemplateSpecializationScope(ClassTemplateDecl *ClassTemplate,
// We have a previous declaration of this entity. Make sure that // We have a previous declaration of this entity. Make sure that
// this redeclaration (or definition) occurs in an enclosing namespace. // this redeclaration (or definition) occurs in an enclosing namespace.
if (!CurContext->Encloses(TemplateContext)) { if (!CurContext->Encloses(TemplateContext)) {
// FIXME: In C++98, we would like to turn these errors into // FIXME: In C++98, we would like to turn these errors into warnings,
// warnings, dependent on a -Wc++0x flag. // dependent on a -Wc++0x flag.
bool SuppressedDiag = false; bool SuppressedDiag = false;
if (isa<TranslationUnitDecl>(TemplateContext)) { if (isa<TranslationUnitDecl>(TemplateContext)) {
if (!ExplicitInstantiation || getLangOptions().CPlusPlus0x) if (!ExplicitInstantiation || getLangOptions().CPlusPlus0x)
@ -2117,8 +2114,8 @@ Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec, TagKind TK,
// Check that this isn't a redefinition of this specialization. // Check that this isn't a redefinition of this specialization.
if (TK == TK_Definition) { if (TK == TK_Definition) {
if (RecordDecl *Def = Specialization->getDefinition(Context)) { if (RecordDecl *Def = Specialization->getDefinition(Context)) {
// FIXME: Should also handle explicit specialization after // FIXME: Should also handle explicit specialization after implicit
// implicit instantiation with a special diagnostic. // instantiation with a special diagnostic.
SourceRange Range(TemplateNameLoc, RAngleLoc); SourceRange Range(TemplateNameLoc, RAngleLoc);
Diag(TemplateNameLoc, diag::err_redefinition) Diag(TemplateNameLoc, diag::err_redefinition)
<< Specialization << Range; << Specialization << Range;
@ -2389,8 +2386,8 @@ Sema::ActOnExplicitInstantiation(Scope *S, SourceLocation TemplateLoc,
// //
// This is C++ DR 275. // This is C++ DR 275.
if (getLangOptions().CPlusPlus0x) { if (getLangOptions().CPlusPlus0x) {
// FIXME: In C++98, we would like to turn these errors into // FIXME: In C++98, we would like to turn these errors into warnings,
// warnings, dependent on a -Wc++0x flag. // dependent on a -Wc++0x flag.
DeclContext *PatternContext DeclContext *PatternContext
= Pattern->getDeclContext()->getEnclosingNamespaceContext(); = Pattern->getDeclContext()->getEnclosingNamespaceContext();
if (!CurContext->Encloses(PatternContext)) { if (!CurContext->Encloses(PatternContext)) {
@ -2415,10 +2412,10 @@ Sema::ActOnExplicitInstantiation(Scope *S, SourceLocation TemplateLoc,
getTemplateInstantiationArgs(Record)); getTemplateInstantiationArgs(Record));
} }
// FIXME: We don't have any representation for explicit // FIXME: We don't have any representation for explicit instantiations of
// instantiations of member classes. Such a representation is not // member classes. Such a representation is not needed for compilation, but it
// needed for compilation, but it should be available for clients // should be available for clients that want to see all of the declarations in
// that want to see all of the declarations in the source code. // the source code.
return TagD; return TagD;
} }

Просмотреть файл

@ -502,8 +502,7 @@ InstantiateTemplateSpecializationType(
} }
} }
// FIXME: We're missing the locations of the template name, '<', and // FIXME: We're missing the locations of the template name, '<', and '>'.
// '>'.
TemplateName Name = SemaRef.InstantiateTemplateName(T->getTemplateName(), TemplateName Name = SemaRef.InstantiateTemplateName(T->getTemplateName(),
Loc, Loc,
@ -752,9 +751,8 @@ Sema::InstantiateClass(SourceLocation PointOfInstantiation,
Fields.push_back(DeclPtrTy::make(Field)); Fields.push_back(DeclPtrTy::make(Field));
} else { } else {
// FIXME: Eventually, a NULL return will mean that one of the // FIXME: Eventually, a NULL return will mean that one of the
// instantiations was a semantic disaster, and we'll want to set // instantiations was a semantic disaster, and we'll want to set Invalid =
// Invalid = true. For now, we expect to skip some members that // true. For now, we expect to skip some members that we can't yet handle.
// we can't yet handle.
} }
} }
@ -790,12 +788,11 @@ Sema::InstantiateClassTemplateSpecialization(
if (ClassTemplateSpec->getSpecializationKind() != TSK_Undeclared) if (ClassTemplateSpec->getSpecializationKind() != TSK_Undeclared)
return true; return true;
// FIXME: Push this class template instantiation onto the // FIXME: Push this class template instantiation onto the instantiation stack,
// instantiation stack, checking for recursion that exceeds a // checking for recursion that exceeds a certain depth.
// certain depth.
// FIXME: Perform class template partial specialization to select // FIXME: Perform class template partial specialization to select the best
// the best template. // template.
ClassTemplateDecl *Template = ClassTemplateSpec->getSpecializedTemplate(); ClassTemplateDecl *Template = ClassTemplateSpec->getSpecializedTemplate();
CXXRecordDecl *Pattern = Template->getTemplatedDecl(); CXXRecordDecl *Pattern = Template->getTemplatedDecl();
@ -977,9 +974,8 @@ Sema::InstantiateTemplateName(TemplateName Name, SourceLocation Loc,
// FIXME: Even if we're referring to a Decl that isn't a template // FIXME: Even if we're referring to a Decl that isn't a template template
// template parameter, we may need to instantiate the outer contexts // parameter, we may need to instantiate the outer contexts of that
// of that Decl. However, this won't be needed until we implement // Decl. However, this won't be needed until we implement member templates.
// member templates.
return Name; return Name;
} }

Просмотреть файл

@ -32,9 +32,9 @@ namespace {
const TemplateArgumentList &TemplateArgs) const TemplateArgumentList &TemplateArgs)
: SemaRef(SemaRef), Owner(Owner), TemplateArgs(TemplateArgs) { } : SemaRef(SemaRef), Owner(Owner), TemplateArgs(TemplateArgs) { }
// FIXME: Once we get closer to completion, replace these // FIXME: Once we get closer to completion, replace these manually-written
// manually-written declarations with automatically-generated ones // declarations with automatically-generated ones from
// from clang/AST/DeclNodes.def. // clang/AST/DeclNodes.def.
Decl *VisitTranslationUnitDecl(TranslationUnitDecl *D); Decl *VisitTranslationUnitDecl(TranslationUnitDecl *D);
Decl *VisitNamespaceDecl(NamespaceDecl *D); Decl *VisitNamespaceDecl(NamespaceDecl *D);
Decl *VisitTypedefDecl(TypedefDecl *D); Decl *VisitTypedefDecl(TypedefDecl *D);
@ -116,8 +116,8 @@ Decl *TemplateDeclInstantiator::VisitVarDecl(VarDecl *D) {
Var->setCXXDirectInitializer(D->hasCXXDirectInitializer()); Var->setCXXDirectInitializer(D->hasCXXDirectInitializer());
Var->setDeclaredInCondition(D->isDeclaredInCondition()); Var->setDeclaredInCondition(D->isDeclaredInCondition());
// FIXME: In theory, we could have a previous declaration for // FIXME: In theory, we could have a previous declaration for variables that
// variables that are not static data members. // are not static data members.
bool Redeclaration = false; bool Redeclaration = false;
SemaRef.CheckVariableDeclaration(Var, 0, Redeclaration); SemaRef.CheckVariableDeclaration(Var, 0, Redeclaration);
Owner->addDecl(SemaRef.Context, Var); Owner->addDecl(SemaRef.Context, Var);

Просмотреть файл

@ -33,9 +33,9 @@ namespace {
const TemplateArgumentList &TemplateArgs) const TemplateArgumentList &TemplateArgs)
: SemaRef(SemaRef), TemplateArgs(TemplateArgs) { } : SemaRef(SemaRef), TemplateArgs(TemplateArgs) { }
// FIXME: Once we get closer to completion, replace these // FIXME: Once we get closer to completion, replace these manually-written
// manually-written declarations with automatically-generated ones // declarations with automatically-generated ones from
// from clang/AST/StmtNodes.def. // clang/AST/StmtNodes.def.
OwningExprResult VisitIntegerLiteral(IntegerLiteral *E); OwningExprResult VisitIntegerLiteral(IntegerLiteral *E);
OwningExprResult VisitDeclRefExpr(DeclRefExpr *E); OwningExprResult VisitDeclRefExpr(DeclRefExpr *E);
OwningExprResult VisitParenExpr(ParenExpr *E); OwningExprResult VisitParenExpr(ParenExpr *E);
@ -247,8 +247,8 @@ TemplateExprInstantiator::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
Functions, move(First)); Functions, move(First));
} }
// FIXME: This would be far less ugly if CreateOverloadedBinOp took // FIXME: This would be far less ugly if CreateOverloadedBinOp took in ExprArg
// in ExprArg arguments! // arguments!
BinaryOperator::Opcode Opc = BinaryOperator::Opcode Opc =
BinaryOperator::getOverloadedOpcode(E->getOperator()); BinaryOperator::getOverloadedOpcode(E->getOperator());
OwningExprResult Result OwningExprResult Result

Просмотреть файл

@ -33,9 +33,9 @@ namespace {
const TemplateArgumentList &TemplateArgs) const TemplateArgumentList &TemplateArgs)
: SemaRef(SemaRef), TemplateArgs(TemplateArgs) { } : SemaRef(SemaRef), TemplateArgs(TemplateArgs) { }
// FIXME: Once we get closer to completion, replace these // FIXME: Once we get closer to completion, replace these manually-written
// manually-written declarations with automatically-generated ones // declarations with automatically-generated ones from
// from clang/AST/StmtNodes.def. // clang/AST/StmtNodes.def.
OwningStmtResult VisitDeclStmt(DeclStmt *S); OwningStmtResult VisitDeclStmt(DeclStmt *S);
OwningStmtResult VisitNullStmt(NullStmt *S); OwningStmtResult VisitNullStmt(NullStmt *S);
OwningStmtResult VisitCompoundStmt(CompoundStmt *S); OwningStmtResult VisitCompoundStmt(CompoundStmt *S);
@ -140,8 +140,8 @@ TemplateStmtInstantiator::VisitReturnStmt(ReturnStmt *S) {
Sema::OwningStmtResult Sema::OwningStmtResult
TemplateStmtInstantiator::VisitCompoundStmt(CompoundStmt *S) { TemplateStmtInstantiator::VisitCompoundStmt(CompoundStmt *S) {
// FIXME: We need an *easy* RAII way to delete these statements if // FIXME: We need an *easy* RAII way to delete these statements if something
// something goes wrong. // goes wrong.
llvm::SmallVector<Stmt *, 16> Statements; llvm::SmallVector<Stmt *, 16> Statements;
for (CompoundStmt::body_iterator B = S->body_begin(), BEnd = S->body_end(); for (CompoundStmt::body_iterator B = S->body_begin(), BEnd = S->body_end();

Просмотреть файл

@ -128,10 +128,9 @@ QualType Sema::ConvertDeclSpecToType(const DeclSpec &DS,
Diag(DeclLoc, diag::warn_missing_type_specifier) Diag(DeclLoc, diag::warn_missing_type_specifier)
<< DS.getSourceRange(); << DS.getSourceRange();
// FIXME: If we could guarantee that the result would be // FIXME: If we could guarantee that the result would be well-formed, it
// well-formed, it would be useful to have a code insertion hint // would be useful to have a code insertion hint here. However, after
// here. However, after emitting this warning/error, we often // emitting this warning/error, we often emit other errors.
// emit other errors.
} }
// FALL THROUGH. // FALL THROUGH.
@ -191,8 +190,8 @@ QualType Sema::ConvertDeclSpecToType(const DeclSpec &DS,
Result = QualType::getFromOpaquePtr(DS.getTypeRep()); Result = QualType::getFromOpaquePtr(DS.getTypeRep());
if (DeclSpec::ProtocolQualifierListTy PQ = DS.getProtocolQualifiers()) { if (DeclSpec::ProtocolQualifierListTy PQ = DS.getProtocolQualifiers()) {
// FIXME: Adding a TST_objcInterface clause doesn't seem ideal, so // FIXME: Adding a TST_objcInterface clause doesn't seem ideal, so we have
// we have this "hack" for now... // this "hack" for now...
if (const ObjCInterfaceType *Interface = Result->getAsObjCInterfaceType()) if (const ObjCInterfaceType *Interface = Result->getAsObjCInterfaceType())
Result = Context.getObjCQualifiedInterfaceType(Interface->getDecl(), Result = Context.getObjCQualifiedInterfaceType(Interface->getDecl(),
(ObjCProtocolDecl**)PQ, (ObjCProtocolDecl**)PQ,