~ubuntu-branches/ubuntu/trusty/kdevelop/trusty

« back to all changes in this revision

Viewing changes to languages/cpp/cppduchain/templatedeclaration.cpp

  • Committer: Package Import Robot
  • Author(s): Rohan Garg
  • Date: 2013-11-04 16:02:55 UTC
  • mfrom: (1.7.18)
  • Revision ID: package-import@ubuntu.com-20131104160255-2c0ve1quekwwb9hs
Tags: 4:4.5.2-0ubuntu1
* New upstream release
* Bump required version of kdevplatform-dev to 1.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
160
160
  uint delayedDepth;
161
161
  // recursion counter for alias type resolution
162
162
  uint aliasDepth;
 
163
  uint specializedFromDepth;
163
164
};
164
165
 
165
166
#if (QT_VERSION >= 0x040801)
219
220
  virtual AbstractType::Ptr exchange( const AbstractType::Ptr& type )
220
221
  {
221
222
    ThreadLocalData& data = threadDataLocal();
222
 
    PushValue<uint> inc(data.delayedDepth, +1);
 
223
    PushValue<uint> inc(data.delayedDepth, data.delayedDepth + 1);
223
224
    if( data.delayedDepth > 30 ) {
224
225
      kDebug(9007) << "Too much depth in DelayedTypeResolver::exchange, while exchanging" << (type ? type->toString() : QString("(null)"));
225
226
      return type;
273
274
        if( aType )
274
275
          aType->exchangeTypes(this);
275
276
 
276
 
        
277
277
        return typeCopy;
278
278
      }
279
279
    }
375
375
}
376
376
 
377
377
void TemplateDeclaration::setSpecializedFrom(TemplateDeclaration* other) {
378
 
  
 
378
  ThreadLocalData& data = threadDataLocal();
 
379
  PushValue<uint> safety(data.specializedFromDepth, data.specializedFromDepth+1);
 
380
  if(data.specializedFromDepth > 30) {
 
381
    QString withVal = "other";
 
382
    if( other ) {
 
383
      if( other->instantiatedFrom() ) {
 
384
        withVal += ".instantiatedFrom() == " + other->instantiatedFrom()->id(true).qualifiedIdentifier().toString();
 
385
      } else if( other->specializedFrom().data() ) {
 
386
        withVal += ".specialiedFrom().data() == " + other->specializedFrom().data()->identifier().toString();
 
387
      } else {
 
388
        withVal += ".specializedFrom().data() == null && other.instantiatedFrom() == null";
 
389
      }
 
390
    } else {
 
391
      withVal = " == null";
 
392
    }
 
393
    kWarning()
 
394
        << "depth-limit reached while setting specializedFrom"
 
395
        << (specializedFrom().data()
 
396
            ? specializedFrom().data()->identifier().toString()
 
397
            : "this specializedFrom is null")
 
398
        << "with" << withVal;
 
399
    return;
 
400
  }
 
401
 
379
402
  if(other && other->instantiatedFrom()) {
380
403
    setSpecializedFrom(other->instantiatedFrom());
381
404
    return;
633
656
        ///an AliasDeclaration represents a C++ "using bla::bla;" declaration.
634
657
        if(AliasDeclaration* alias = dynamic_cast<AliasDeclaration*>(instantiatedDeclaration)) {
635
658
          ThreadLocalData& data = threadDataLocal();
636
 
          PushValue<uint> safety(data.aliasDepth, +1);
 
659
          PushValue<uint> safety(data.aliasDepth, data.delayedDepth + 1);
637
660
          if(data.aliasDepth > 30) {
638
661
            kWarning() << "depth-limit reached while resolving alias-declaration" << alias->identifier().toString() << "within" << parentContext->scopeIdentifier(true).toString();
639
662
          }else {