http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56019

             Bug #: 56019
           Summary: max_align_t should be in std namespace
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: kr...@kde.org


According to 3.11.2 in the C++11 standard max_align_t should be inside the std
namespace (i.e. the text talks about use of alignof(std::max_align_t)). GCC
only provides ::max_align_t, though:

% cat main.cpp                                                                 
                                                                               
                                                                #include
<cstddef>
int main()
{
    return alignof(std::max_align_t);
}

% /opt/gcc-4.7.2/bin/g++ -Wall -std=c++11 -o test main.cpp
main.cpp: In function ‘int main()’:
main.cpp:4:20: error: ‘max_align_t’ is not a member of ‘std’
main.cpp:4:20: note: suggested alternative:
In file included from
/home/.opt/gcc-4.7.2/bin/../lib/gcc/x86_64-suse-linux-gnu/4.7.2/../../../../include/c++/4.7.2/cstddef:44:0,
                 from main.cpp:1:
/home/.opt/gcc-4.7.2/bin/../lib/gcc/x86_64-suse-linux-gnu/4.7.2/include/stddef.h:426:3:
note:   ‘max_align_t’

% /opt/gcc-4.8-snapshot/bin/g++ -Wall -std=c++11 -o test main.cpp
main.cpp: In function ‘int main()’:
main.cpp:4:20: error: ‘max_align_t’ is not a member of ‘std’
     return alignof(std::max_align_t);
                    ^
main.cpp:4:20: note: suggested alternative:
In file included from
/home/.opt/gcc-4.8-snapshot/include/c++/4.8.0/cstddef:44:0,
                 from main.cpp:1:
/home/.opt/gcc-4.8-snapshot/lib/gcc/x86_64-suse-linux-gnu/4.8.0/include/stddef.h:425:3:
note:   ‘max_align_t’
 } max_align_t;
   ^

Reply via email to