Skip to content
Snippets Groups Projects
  1. Aug 05, 2014
  2. Jul 22, 2014
    • 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. Jul 04, 2014
  4. Jun 24, 2014
  5. Jun 17, 2014
    • 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. Jun 16, 2014
  7. Jun 12, 2014
  8. Jun 06, 2014
  9. Jun 04, 2014
  10. Mar 13, 2014
  11. Jan 20, 2014
  12. Nov 26, 2013
  13. Nov 12, 2013
  14. Oct 15, 2013
  15. Oct 09, 2013
  16. Aug 21, 2013
  17. Jul 19, 2013
  18. Jun 06, 2013
  19. Apr 19, 2013
  20. Apr 18, 2013
  21. Apr 15, 2013
  22. Apr 09, 2013
  23. Jan 16, 2013
  24. Jan 08, 2013
    • 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. Nov 28, 2012
  26. Nov 07, 2012
  27. Oct 11, 2012
  28. Sep 28, 2012
  29. Sep 25, 2012
  30. Sep 24, 2012
  31. Sep 20, 2012
  32. Sep 19, 2012
Loading