forked from OSchip/llvm-project
				
			Back out r70506 (exception spec in AST) again. We won't have exception specs until we've had a lot more discussion.
llvm-svn: 71125
This commit is contained in:
		
							parent
							
								
									39b480cea0
								
							
						
					
					
						commit
						f08aa62c80
					
				| 
						 | 
					@ -294,9 +294,7 @@ public:
 | 
				
			||||||
  /// list.  isVariadic indicates whether the argument list includes '...'.
 | 
					  /// list.  isVariadic indicates whether the argument list includes '...'.
 | 
				
			||||||
  QualType getFunctionType(QualType ResultTy, const QualType *ArgArray,
 | 
					  QualType getFunctionType(QualType ResultTy, const QualType *ArgArray,
 | 
				
			||||||
                           unsigned NumArgs, bool isVariadic,
 | 
					                           unsigned NumArgs, bool isVariadic,
 | 
				
			||||||
                           unsigned TypeQuals, bool hasExceptionSpec = false,
 | 
					                           unsigned TypeQuals);
 | 
				
			||||||
                           bool hasAnyExceptionSpec = false,
 | 
					 | 
				
			||||||
                           unsigned NumExs = 0, const QualType *ExArray = 0);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /// getTypeDeclType - Return the unique reference to the type for
 | 
					  /// getTypeDeclType - Return the unique reference to the type for
 | 
				
			||||||
  /// the specified type declaration.
 | 
					  /// the specified type declaration.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1161,42 +1161,23 @@ class FunctionProtoType : public FunctionType, public llvm::FoldingSetNode {
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  FunctionProtoType(QualType Result, const QualType *ArgArray, unsigned numArgs,
 | 
					  FunctionProtoType(QualType Result, const QualType *ArgArray, unsigned numArgs,
 | 
				
			||||||
                    bool isVariadic, unsigned typeQuals, bool hasExs,
 | 
					                    bool isVariadic, unsigned typeQuals, QualType Canonical)
 | 
				
			||||||
                    bool hasAnyExs, const QualType *ExArray,
 | 
					 | 
				
			||||||
                    unsigned numExs, QualType Canonical)
 | 
					 | 
				
			||||||
    : FunctionType(FunctionProto, Result, isVariadic, typeQuals, Canonical,
 | 
					    : FunctionType(FunctionProto, Result, isVariadic, typeQuals, Canonical,
 | 
				
			||||||
                   (Result->isDependentType() || 
 | 
					                   (Result->isDependentType() || 
 | 
				
			||||||
                    hasAnyDependentType(ArgArray, numArgs))),
 | 
					                    hasAnyDependentType(ArgArray, numArgs))),
 | 
				
			||||||
      NumArgs(numArgs), NumExceptions(numExs), HasExceptionSpec(hasExs),
 | 
					      NumArgs(numArgs) {
 | 
				
			||||||
      AnyExceptionSpec(hasAnyExs) {
 | 
					 | 
				
			||||||
    // Fill in the trailing argument array.
 | 
					    // Fill in the trailing argument array.
 | 
				
			||||||
    QualType *ArgInfo = reinterpret_cast<QualType*>(this+1);
 | 
					    QualType *ArgInfo = reinterpret_cast<QualType *>(this+1);;
 | 
				
			||||||
    for (unsigned i = 0; i != numArgs; ++i)
 | 
					    for (unsigned i = 0; i != numArgs; ++i)
 | 
				
			||||||
      ArgInfo[i] = ArgArray[i];
 | 
					      ArgInfo[i] = ArgArray[i];
 | 
				
			||||||
    // Fill in the exception array.
 | 
					 | 
				
			||||||
    QualType *Ex = ArgInfo + numArgs;
 | 
					 | 
				
			||||||
    for (unsigned i = 0; i != numExs; ++i)
 | 
					 | 
				
			||||||
      Ex[i] = ExArray[i];
 | 
					 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  /// NumArgs - The number of arguments this function has, not counting '...'.
 | 
					  /// NumArgs - The number of arguments this function has, not counting '...'.
 | 
				
			||||||
  unsigned NumArgs : 20;
 | 
					  unsigned NumArgs;
 | 
				
			||||||
 | 
					 | 
				
			||||||
  /// NumExceptions - The number of types in the exception spec, if any.
 | 
					 | 
				
			||||||
  unsigned NumExceptions : 10;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  /// HasExceptionSpec - Whether this function has an exception spec at all.
 | 
					 | 
				
			||||||
  bool HasExceptionSpec : 1;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  /// AnyExceptionSpec - Whether this function has a throw(...) spec.
 | 
					 | 
				
			||||||
  bool AnyExceptionSpec : 1;
 | 
					 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  /// ArgInfo - There is an variable size array after the class in memory that
 | 
					  /// ArgInfo - There is an variable size array after the class in memory that
 | 
				
			||||||
  /// holds the argument types.
 | 
					  /// holds the argument types.
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  /// Exceptions - There is another variable size array after ArgInfo that
 | 
					 | 
				
			||||||
  /// holds the exception types.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  friend class ASTContext;  // ASTContext creates these.
 | 
					  friend class ASTContext;  // ASTContext creates these.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
| 
						 | 
					@ -1206,14 +1187,6 @@ public:
 | 
				
			||||||
    return arg_type_begin()[i];
 | 
					    return arg_type_begin()[i];
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
  bool hasExceptionSpec() const { return HasExceptionSpec; }
 | 
					 | 
				
			||||||
  bool hasAnyExceptionSpec() const { return AnyExceptionSpec; }
 | 
					 | 
				
			||||||
  unsigned getNumExceptions() const { return NumExceptions; }
 | 
					 | 
				
			||||||
  QualType getExceptionType(unsigned i) const {
 | 
					 | 
				
			||||||
    assert(i < NumExceptions && "Invalid exception number!");
 | 
					 | 
				
			||||||
    return exception_begin()[i];
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  bool isVariadic() const { return getSubClassData(); }
 | 
					  bool isVariadic() const { return getSubClassData(); }
 | 
				
			||||||
  unsigned getTypeQuals() const { return FunctionType::getTypeQuals(); }
 | 
					  unsigned getTypeQuals() const { return FunctionType::getTypeQuals(); }
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
| 
						 | 
					@ -1223,15 +1196,6 @@ public:
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  arg_type_iterator arg_type_end() const { return arg_type_begin()+NumArgs; }
 | 
					  arg_type_iterator arg_type_end() const { return arg_type_begin()+NumArgs; }
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  typedef const QualType *exception_iterator;
 | 
					 | 
				
			||||||
  exception_iterator exception_begin() const {
 | 
					 | 
				
			||||||
    // exceptions begin where arguments end
 | 
					 | 
				
			||||||
    return arg_type_end();
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
  exception_iterator exception_end() const {
 | 
					 | 
				
			||||||
    return exception_begin() + NumExceptions;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  virtual void getAsStringInternal(std::string &InnerString) const;
 | 
					  virtual void getAsStringInternal(std::string &InnerString) const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  static bool classof(const Type *T) {
 | 
					  static bool classof(const Type *T) {
 | 
				
			||||||
| 
						 | 
					@ -1242,9 +1206,7 @@ public:
 | 
				
			||||||
  void Profile(llvm::FoldingSetNodeID &ID);
 | 
					  void Profile(llvm::FoldingSetNodeID &ID);
 | 
				
			||||||
  static void Profile(llvm::FoldingSetNodeID &ID, QualType Result,
 | 
					  static void Profile(llvm::FoldingSetNodeID &ID, QualType Result,
 | 
				
			||||||
                      arg_type_iterator ArgTys, unsigned NumArgs,
 | 
					                      arg_type_iterator ArgTys, unsigned NumArgs,
 | 
				
			||||||
                      bool isVariadic, unsigned TypeQuals,
 | 
					                      bool isVariadic, unsigned TypeQuals);
 | 
				
			||||||
                      bool hasExceptionSpec, bool anyExceptionSpec,
 | 
					 | 
				
			||||||
                      unsigned NumExceptions, exception_iterator Exs);
 | 
					 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1296,15 +1296,12 @@ QualType ASTContext::getFunctionNoProtoType(QualType ResultTy) {
 | 
				
			||||||
/// list.  isVariadic indicates whether the argument list includes '...'.
 | 
					/// list.  isVariadic indicates whether the argument list includes '...'.
 | 
				
			||||||
QualType ASTContext::getFunctionType(QualType ResultTy,const QualType *ArgArray,
 | 
					QualType ASTContext::getFunctionType(QualType ResultTy,const QualType *ArgArray,
 | 
				
			||||||
                                     unsigned NumArgs, bool isVariadic,
 | 
					                                     unsigned NumArgs, bool isVariadic,
 | 
				
			||||||
                                     unsigned TypeQuals, bool hasExceptionSpec,
 | 
					                                     unsigned TypeQuals) {
 | 
				
			||||||
                                     bool hasAnyExceptionSpec, unsigned NumExs,
 | 
					 | 
				
			||||||
                                     const QualType *ExArray) {
 | 
					 | 
				
			||||||
  // Unique functions, to guarantee there is only one function of a particular
 | 
					  // Unique functions, to guarantee there is only one function of a particular
 | 
				
			||||||
  // structure.
 | 
					  // structure.
 | 
				
			||||||
  llvm::FoldingSetNodeID ID;
 | 
					  llvm::FoldingSetNodeID ID;
 | 
				
			||||||
  FunctionProtoType::Profile(ID, ResultTy, ArgArray, NumArgs, isVariadic,
 | 
					  FunctionProtoType::Profile(ID, ResultTy, ArgArray, NumArgs, isVariadic,
 | 
				
			||||||
                             TypeQuals, hasExceptionSpec, hasAnyExceptionSpec,
 | 
					                             TypeQuals);
 | 
				
			||||||
                             NumExs, ExArray);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  void *InsertPos = 0;
 | 
					  void *InsertPos = 0;
 | 
				
			||||||
  if (FunctionProtoType *FTP = 
 | 
					  if (FunctionProtoType *FTP = 
 | 
				
			||||||
| 
						 | 
					@ -1324,15 +1321,10 @@ QualType ASTContext::getFunctionType(QualType ResultTy,const QualType *ArgArray,
 | 
				
			||||||
    CanonicalArgs.reserve(NumArgs);
 | 
					    CanonicalArgs.reserve(NumArgs);
 | 
				
			||||||
    for (unsigned i = 0; i != NumArgs; ++i)
 | 
					    for (unsigned i = 0; i != NumArgs; ++i)
 | 
				
			||||||
      CanonicalArgs.push_back(getCanonicalType(ArgArray[i]));
 | 
					      CanonicalArgs.push_back(getCanonicalType(ArgArray[i]));
 | 
				
			||||||
    llvm::SmallVector<QualType, 2> CanonicalExs;
 | 
					 | 
				
			||||||
    CanonicalExs.reserve(NumExs);
 | 
					 | 
				
			||||||
    for (unsigned i = 0; i != NumExs; ++i)
 | 
					 | 
				
			||||||
      CanonicalExs.push_back(getCanonicalType(ExArray[i]));
 | 
					 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    Canonical = getFunctionType(getCanonicalType(ResultTy),
 | 
					    Canonical = getFunctionType(getCanonicalType(ResultTy),
 | 
				
			||||||
                                &CanonicalArgs[0], NumArgs,
 | 
					                                &CanonicalArgs[0], NumArgs,
 | 
				
			||||||
                                isVariadic, TypeQuals, hasExceptionSpec,
 | 
					                                isVariadic, TypeQuals);
 | 
				
			||||||
                                hasAnyExceptionSpec, NumExs, &CanonicalExs[0]);
 | 
					 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    // Get the new insert position for the node we care about.
 | 
					    // Get the new insert position for the node we care about.
 | 
				
			||||||
    FunctionProtoType *NewIP =
 | 
					    FunctionProtoType *NewIP =
 | 
				
			||||||
| 
						 | 
					@ -1341,15 +1333,12 @@ QualType ASTContext::getFunctionType(QualType ResultTy,const QualType *ArgArray,
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  // FunctionProtoType objects are allocated with extra bytes after them
 | 
					  // FunctionProtoType objects are allocated with extra bytes after them
 | 
				
			||||||
  // for two variable size arrays (for parameter and exception types) at the
 | 
					  // for a variable size array (for parameter types) at the end of them.
 | 
				
			||||||
  // end of them.
 | 
					 | 
				
			||||||
  FunctionProtoType *FTP = 
 | 
					  FunctionProtoType *FTP = 
 | 
				
			||||||
    (FunctionProtoType*)Allocate(sizeof(FunctionProtoType) + 
 | 
					    (FunctionProtoType*)Allocate(sizeof(FunctionProtoType) + 
 | 
				
			||||||
                                 NumArgs*sizeof(QualType) +
 | 
					                                 NumArgs*sizeof(QualType), 8);
 | 
				
			||||||
                                 NumExs*sizeof(QualType), 8);
 | 
					 | 
				
			||||||
  new (FTP) FunctionProtoType(ResultTy, ArgArray, NumArgs, isVariadic,
 | 
					  new (FTP) FunctionProtoType(ResultTy, ArgArray, NumArgs, isVariadic,
 | 
				
			||||||
                              TypeQuals, hasExceptionSpec, hasAnyExceptionSpec,
 | 
					                              TypeQuals, Canonical);
 | 
				
			||||||
                              ExArray, NumExs, Canonical);
 | 
					 | 
				
			||||||
  Types.push_back(FTP);
 | 
					  Types.push_back(FTP);
 | 
				
			||||||
  FunctionProtoTypes.InsertNode(FTP, InsertPos);
 | 
					  FunctionProtoTypes.InsertNode(FTP, InsertPos);
 | 
				
			||||||
  return QualType(FTP, 0);
 | 
					  return QualType(FTP, 0);
 | 
				
			||||||
| 
						 | 
					@ -2916,8 +2905,6 @@ QualType ASTContext::mergeFunctionTypes(QualType lhs, QualType rhs) {
 | 
				
			||||||
    allRTypes = false;
 | 
					    allRTypes = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (lproto && rproto) { // two C99 style function prototypes
 | 
					  if (lproto && rproto) { // two C99 style function prototypes
 | 
				
			||||||
    assert(!lproto->hasExceptionSpec() && !rproto->hasExceptionSpec() &&
 | 
					 | 
				
			||||||
           "C++ shouldn't be here");
 | 
					 | 
				
			||||||
    unsigned lproto_nargs = lproto->getNumArgs();
 | 
					    unsigned lproto_nargs = lproto->getNumArgs();
 | 
				
			||||||
    unsigned rproto_nargs = rproto->getNumArgs();
 | 
					    unsigned rproto_nargs = rproto->getNumArgs();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2956,7 +2943,6 @@ QualType ASTContext::mergeFunctionTypes(QualType lhs, QualType rhs) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const FunctionProtoType *proto = lproto ? lproto : rproto;
 | 
					  const FunctionProtoType *proto = lproto ? lproto : rproto;
 | 
				
			||||||
  if (proto) {
 | 
					  if (proto) {
 | 
				
			||||||
    assert(!proto->hasExceptionSpec() && "C++ shouldn't be here");
 | 
					 | 
				
			||||||
    if (proto->isVariadic()) return QualType();
 | 
					    if (proto->isVariadic()) return QualType();
 | 
				
			||||||
    // Check that the types are compatible with the types that
 | 
					    // Check that the types are compatible with the types that
 | 
				
			||||||
    // would result from default argument promotions (C99 6.7.5.3p15).
 | 
					    // would result from default argument promotions (C99 6.7.5.3p15).
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -920,26 +920,17 @@ const char *BuiltinType::getName() const {
 | 
				
			||||||
void FunctionProtoType::Profile(llvm::FoldingSetNodeID &ID, QualType Result,
 | 
					void FunctionProtoType::Profile(llvm::FoldingSetNodeID &ID, QualType Result,
 | 
				
			||||||
                                arg_type_iterator ArgTys,
 | 
					                                arg_type_iterator ArgTys,
 | 
				
			||||||
                                unsigned NumArgs, bool isVariadic,
 | 
					                                unsigned NumArgs, bool isVariadic,
 | 
				
			||||||
                                unsigned TypeQuals, bool hasExceptionSpec,
 | 
					                                unsigned TypeQuals) {
 | 
				
			||||||
                                bool anyExceptionSpec, unsigned NumExceptions,
 | 
					 | 
				
			||||||
                                exception_iterator Exs) {
 | 
					 | 
				
			||||||
  ID.AddPointer(Result.getAsOpaquePtr());
 | 
					  ID.AddPointer(Result.getAsOpaquePtr());
 | 
				
			||||||
  for (unsigned i = 0; i != NumArgs; ++i)
 | 
					  for (unsigned i = 0; i != NumArgs; ++i)
 | 
				
			||||||
    ID.AddPointer(ArgTys[i].getAsOpaquePtr());
 | 
					    ID.AddPointer(ArgTys[i].getAsOpaquePtr());
 | 
				
			||||||
  ID.AddInteger(isVariadic);
 | 
					  ID.AddInteger(isVariadic);
 | 
				
			||||||
  ID.AddInteger(TypeQuals);
 | 
					  ID.AddInteger(TypeQuals);
 | 
				
			||||||
  ID.AddInteger(hasExceptionSpec);
 | 
					 | 
				
			||||||
  if (hasExceptionSpec) {
 | 
					 | 
				
			||||||
    ID.AddInteger(anyExceptionSpec);
 | 
					 | 
				
			||||||
    for(unsigned i = 0; i != NumExceptions; ++i)
 | 
					 | 
				
			||||||
      ID.AddPointer(Exs[i].getAsOpaquePtr());
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void FunctionProtoType::Profile(llvm::FoldingSetNodeID &ID) {
 | 
					void FunctionProtoType::Profile(llvm::FoldingSetNodeID &ID) {
 | 
				
			||||||
  Profile(ID, getResultType(), arg_type_begin(), NumArgs, isVariadic(),
 | 
					  Profile(ID, getResultType(), arg_type_begin(), NumArgs, isVariadic(),
 | 
				
			||||||
          getTypeQuals(), hasExceptionSpec(), hasAnyExceptionSpec(),
 | 
					          getTypeQuals());
 | 
				
			||||||
          getNumExceptions(), exception_begin());
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void ObjCQualifiedInterfaceType::Profile(llvm::FoldingSetNodeID &ID,
 | 
					void ObjCQualifiedInterfaceType::Profile(llvm::FoldingSetNodeID &ID,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1584,16 +1584,8 @@ QualType PCHReader::ReadTypeRecord(uint64_t Offset) {
 | 
				
			||||||
      ParamTypes.push_back(GetType(Record[Idx++]));
 | 
					      ParamTypes.push_back(GetType(Record[Idx++]));
 | 
				
			||||||
    bool isVariadic = Record[Idx++];
 | 
					    bool isVariadic = Record[Idx++];
 | 
				
			||||||
    unsigned Quals = Record[Idx++];
 | 
					    unsigned Quals = Record[Idx++];
 | 
				
			||||||
    bool hasExceptionSpec = Record[Idx++];
 | 
					 | 
				
			||||||
    bool hasAnyExceptionSpec = Record[Idx++];
 | 
					 | 
				
			||||||
    unsigned NumExceptions = Record[Idx++];
 | 
					 | 
				
			||||||
    llvm::SmallVector<QualType, 2> Exceptions;
 | 
					 | 
				
			||||||
    for (unsigned I = 0; I != NumExceptions; ++I)
 | 
					 | 
				
			||||||
      Exceptions.push_back(GetType(Record[Idx++]));
 | 
					 | 
				
			||||||
    return Context->getFunctionType(ResultType, &ParamTypes[0], NumParams,
 | 
					    return Context->getFunctionType(ResultType, &ParamTypes[0], NumParams,
 | 
				
			||||||
                                    isVariadic, Quals, hasExceptionSpec,
 | 
					                                    isVariadic, Quals);
 | 
				
			||||||
                                    hasAnyExceptionSpec, NumExceptions,
 | 
					 | 
				
			||||||
                                    &Exceptions[0]);
 | 
					 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  case pch::TYPE_TYPEDEF:
 | 
					  case pch::TYPE_TYPEDEF:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -161,11 +161,6 @@ void PCHTypeWriter::VisitFunctionProtoType(const FunctionProtoType *T) {
 | 
				
			||||||
    Writer.AddTypeRef(T->getArgType(I), Record);
 | 
					    Writer.AddTypeRef(T->getArgType(I), Record);
 | 
				
			||||||
  Record.push_back(T->isVariadic());
 | 
					  Record.push_back(T->isVariadic());
 | 
				
			||||||
  Record.push_back(T->getTypeQuals());
 | 
					  Record.push_back(T->getTypeQuals());
 | 
				
			||||||
  Record.push_back(T->hasExceptionSpec());
 | 
					 | 
				
			||||||
  Record.push_back(T->hasAnyExceptionSpec());
 | 
					 | 
				
			||||||
  Record.push_back(T->getNumExceptions());
 | 
					 | 
				
			||||||
  for (unsigned I = 0, N = T->getNumExceptions(); I != N; ++I)
 | 
					 | 
				
			||||||
    Writer.AddTypeRef(T->getExceptionType(I), Record);
 | 
					 | 
				
			||||||
  Code = pch::TYPE_FUNCTION_PROTO;
 | 
					  Code = pch::TYPE_FUNCTION_PROTO;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -714,7 +714,6 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, Decl *OldD) {
 | 
				
			||||||
        (OldProto = dyn_cast<FunctionProtoType>(OldFuncType))) {
 | 
					        (OldProto = dyn_cast<FunctionProtoType>(OldFuncType))) {
 | 
				
			||||||
      // The old declaration provided a function prototype, but the
 | 
					      // The old declaration provided a function prototype, but the
 | 
				
			||||||
      // new declaration does not. Merge in the prototype.
 | 
					      // new declaration does not. Merge in the prototype.
 | 
				
			||||||
      assert(!OldProto->hasExceptionSpec() && "Exception spec in C");
 | 
					 | 
				
			||||||
      llvm::SmallVector<QualType, 16> ParamTypes(OldProto->arg_type_begin(),
 | 
					      llvm::SmallVector<QualType, 16> ParamTypes(OldProto->arg_type_begin(),
 | 
				
			||||||
                                                 OldProto->arg_type_end());
 | 
					                                                 OldProto->arg_type_end());
 | 
				
			||||||
      NewQType = Context.getFunctionType(NewFuncType->getResultType(),
 | 
					      NewQType = Context.getFunctionType(NewFuncType->getResultType(),
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -995,9 +995,6 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) {
 | 
				
			||||||
  QualType ClassType = Context.getTypeDeclType(ClassDecl);
 | 
					  QualType ClassType = Context.getTypeDeclType(ClassDecl);
 | 
				
			||||||
  ClassType = Context.getCanonicalType(ClassType);
 | 
					  ClassType = Context.getCanonicalType(ClassType);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // FIXME: Implicit declarations have exception specifications, which are
 | 
					 | 
				
			||||||
  // the union of the specifications of the implicitly called functions.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  if (!ClassDecl->hasUserDeclaredConstructor()) {
 | 
					  if (!ClassDecl->hasUserDeclaredConstructor()) {
 | 
				
			||||||
    // C++ [class.ctor]p5:
 | 
					    // C++ [class.ctor]p5:
 | 
				
			||||||
    //   A default constructor for a class X is a constructor of class X
 | 
					    //   A default constructor for a class X is a constructor of class X
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue