MyDeveloperDay added a comment.

  Foo<const Foo<int>> P; 
  
  // This is needed to trigger the above 'const const' bug above:
  #if 0
  #else
  #endif

produces

  Foo<Foo<int> const const> P;

This bug is caused by the way clang-format re-parses the code for each 
conditional that the preprocessor caused (I actually didn't know it did this, 
or why)

The more conditional branches we introduce the more this goes wrong...

  // 'const >' inserted instead of 'const':
  Foo<Foo<int> const const const const> P;
  
  #if 0
  #if 1
  #else
  #endif
  #else
  #endif

I'm not yet sure of the solution or the reason.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69764/new/

https://reviews.llvm.org/D69764



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to