1. 05 Aug, 2014 1 commit
  2. 22 Jul, 2014 1 commit
    • Erik Verbruggen's avatar
      C++: block recursion when parsing subsequent case statements. · 5d45e0b6
      Erik Verbruggen authored
      
      
      A case or a default statement must be followed by another statement.
      When a such a case (or default) statement is followed immediately by
      another case (or default) statement, then this would create a linked
      list, and the parser will recurse to parse such input.
      
      In order to prevent the parser running out of stack space while
      recursing, parse this corner case by blocking parsing a labeled
      statement as the first statement after a labeled statement.
      
      The advantage is that these statements do not form a linked list, so any
      subsequent visitation of the AST won't run out of stack space either.
      
      Change-Id: Id2111a49509132997f5fbe4bb12c92c729ec2522
      Task-number: QTCREATORBUG-12673
      Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@digia.com>
      5d45e0b6
  3. 04 Jul, 2014 1 commit
  4. 24 Jun, 2014 2 commits
  5. 17 Jun, 2014 1 commit
    • Wang Hoi's avatar
      C: Parser: Support parsing of c99 designated initializers · c56b999f
      Wang Hoi authored
      
      
      In case:
      
          int a[6] = { [4] = 29, [2] = 15 };
          struct point { int x, y; };
          struct point p = { .y = 3, .x = 2 };
      
      Grammar change when c99 language feature is enabled:
      old grammar:
      
          braced-init-list :: '{' initializer-list '}'
      
      new grammar:
      
          braced-init-list :: '{' designated-initializer-list '}'
          designated-initializer-list :: designated-initializer (',' designated-initializer )*
          designated-initializer :: designator* initializer-clause
          designator :: '.' identifier
                      | '[' constant-expression ']'
      
      Task-number: QTCREATORBUG-1902
      Change-Id: Ib99d6f553f8d0f50ba3eff86f3a2e86d73372426
      Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@digia.com>
      c56b999f
  6. 16 Jun, 2014 1 commit
  7. 12 Jun, 2014 1 commit
  8. 06 Jun, 2014 1 commit
  9. 04 Jun, 2014 1 commit
  10. 13 Mar, 2014 1 commit
  11. 20 Jan, 2014 2 commits
  12. 26 Nov, 2013 1 commit
  13. 12 Nov, 2013 1 commit
  14. 15 Oct, 2013 1 commit
  15. 09 Oct, 2013 1 commit
  16. 21 Aug, 2013 1 commit
  17. 19 Jul, 2013 1 commit
  18. 06 Jun, 2013 1 commit
  19. 19 Apr, 2013 1 commit
  20. 18 Apr, 2013 1 commit
  21. 15 Apr, 2013 2 commits
  22. 09 Apr, 2013 1 commit
  23. 16 Jan, 2013 1 commit
  24. 08 Jan, 2013 2 commits
    • Francois Ferrand's avatar
      C++: fix constructor definition parsing. · 5e8c3f4b
      Francois Ferrand authored
      
      
      When a constructor is defined with a single, unnamed argument of a custom type without
      extra type specifiers (const...), then the constructor was not identified as such.
      There was an heuristic in case the constructor was in the class definition, but not if the
      the constructor was defined later.
      
      Examples:
      
      class Arg;
      class Other;
      
      class Foo {
        Foo(Arg /*arg*/);               // working
        Foo(const Arg /*arg*/);         // working
        Foo(int /*arg*/);               // working
        Foo(Other /*arg*/)         {}   // working
      };
      
      Foo::Foo(Arg /*arg*/)        {}   // used not to work, fixed
      Foo::Foo(Arg arg){}               // working
      Foo::Foo(const Arg /*arg*/)  {}   // working
      Foo::Foo(int arg)            {}   // working
      
      Change-Id: I741e4ba62672ddc99a837fdcdc27996fba5ae6c7
      Reviewed-by: default avatarhjk <qthjk@ovi.com>
      5e8c3f4b
    • Orgad Shaneh's avatar
      Remove braces for single lines of conditions · 29a93998
      Orgad Shaneh authored
      
      
      #!/usr/bin/env ruby
      
      Dir.glob('**/*.cpp') { |file|
        # skip ast (excluding paste, astpath, and canv'ast'imer)
        next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
        s = File.read(file)
        next if s.include?('qlalr')
        orig = s.dup
        s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
          res = $&
          if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
            res
          else
            res.gsub!('} else', 'else')
            res.gsub!(/\n +} *\n/m, "\n")
            res.gsub(/ *{$/, '')
          end
        }
        s.gsub!(/ *$/, '')
        File.open(file, 'wb').write(s) if s != orig
      }
      
      Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
      Reviewed-by: default avatarhjk <qthjk@ovi.com>
      29a93998
  25. 28 Nov, 2012 1 commit
  26. 07 Nov, 2012 1 commit
  27. 11 Oct, 2012 1 commit
  28. 28 Sep, 2012 1 commit
  29. 25 Sep, 2012 1 commit
  30. 24 Sep, 2012 1 commit
  31. 20 Sep, 2012 1 commit
  32. 19 Sep, 2012 5 commits