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

Include guard lacks underscore when adding new C++ class

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • Qt Creator 13.0.0-beta1
    • Qt Creator 12.0.0
    • C/C++/Obj-C++ Support
    • None
    • Ubuntu 22.04 LTS, Qt SDK 6.5.3
    • Linux/X11
    • 335c552bd (master)

    Description

      Steps to reproduce (on any C++ project):

      1) Select File => New file => C++ Class

      2) Set Class name to "FooBar", Header file to "foo_bar.hpp" and Source file to "foo_bar.cpp"

      3) Finish the wizard

       

      What happens (no underscore between FOO and BAR):

       

      #ifndef FOOBAR_HPP
      #define FOOBAR_HPP
      
      class FooBar
      {
      public:
          FooBar();
      };
      
      #endif // FOOBAR_HPP
      

       

      What should happen (there should be an underscore between FOO and BAR):

       

      #ifndef FOO_BAR_HPP
      #define FOO_BAR_HPP
      
      class FooBar
      {
      public:
          FooBar();
      };
      
      #endif // FOO_BAR_HPP
      

       

      Notice that this works correctly when the user chooses to add only a header file. The current behavior is thus also inconsistent.

       

       

       

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            juzzlin Jussi Lind
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes