Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-13253

Digraph are parsed after macro expansion

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P2: Important
    • None
    • Qt Creator 3.0.0, Qt Creator 3.0.1, Qt Creator 3.1.0, Qt Creator 3.1.1, Qt Creator 3.1.2, Qt Creator 3.2.0, Qt Creator 3.2.1, Qt Creator 3.2.2, Qt Creator 3.3.0-beta1
    • C/C++/Obj-C++ Support
    • None

    Description

      Since QtCreator 3.0, digraph (and some trigraphs) are now supported, see https://bugreports.qt-project.org/browse/QTCREATORBUG-2474.

      It seems however that the digraph are parsed after preprocessor, instead of before. Thus if a macro argument starts with a collon, which get concatenated with the less sign in the macro.

      The problem can be seen with the following code, which works perfectly fine with both GCC and Clang, but is shown with a parse error in QtCreator (on next line actually).

       
      template<typename T> class Foo {};
      class Bar {};
      
      #define FOO(ARG) bool foo(Foo<ARG>& a1);
      FOO(::Bar)
      int y;
      

      My understanding is that digraph should only be parsed before preprocessor, or generated by the preprocessor's concatenation operator. Esp. they should be ignored if they happen as the result of 'simple' macro argument replacement.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kosjar Nikolai Kosjar
            typz Francois Ferrand
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes