Review Request 118852: [kconfig] Fix build on Visual C++ 2010

Nicolás Alvarez nicolas.alvarez at gmail.com
Sat Jun 28 00:35:36 UTC 2014



> On June 27, 2014, 9:02 p.m., David Faure wrote:
> > autotests/kconfigtest.cpp, line 175
> > <https://git.reviewboard.kde.org/r/118852/diff/1/?file=282763#file282763line175>
> >
> >     So any idea what in here triggers the ICE, more specifically, if it's not related to enums?

Minimal ICE test case:

#include <QtCore/QFlags>

class KConfigGroup {
public:
    enum WriteConfigFlag {
        Persistent = 0x01,
        Global = 0x02,
        Localized = 0x04
    };
    Q_DECLARE_FLAGS(WriteConfigFlags, WriteConfigFlag)
    template <typename T>
    void writeEntry(const T &value, WriteConfigFlags pFlags = Persistent);
};

template<>
void KConfigGroup::writeEntry(const int& value, KConfigGroup::WriteConfigFlags flags) {}

void xxx() {
    KConfigGroup cg;
    cg.writeEntry(1);
    cg.writeEntry(2);
}


- Nicolás


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/118852/#review61114
-----------------------------------------------------------


On June 20, 2014, 9:20 p.m., Nicolás Alvarez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/118852/
> -----------------------------------------------------------
> 
> (Updated June 20, 2014, 9:20 p.m.)
> 
> 
> Review request for KDE Frameworks and kdewin.
> 
> 
> Repository: kconfig
> 
> 
> Description
> -------
> 
> Visual C++ 2010 throws an internal compiler error trying to compile kconfigtest, since 5f4dc2973f. I couldn't figure out a non-intrusive code tweak that would work around the ICE, so I had to skip compiling this particular initialization code on this particular compiler version, and skip running the test that relies on it (testEnums).
> 
> The dummy=42 entry is so that the config group isn't empty, which makes testGroupCopyTo and testReparent still run and pass.
> 
> 
> Diffs
> -----
> 
>   autotests/kconfigtest.cpp a8482b7 
> 
> Diff: https://git.reviewboard.kde.org/r/118852/diff/
> 
> 
> Testing
> -------
> 
> Compiles on MSVC2010, kconfigtest passes (with testEnums skipped).
> 
> I haven't tried compiling on other compilers.
> 
> 
> Thanks,
> 
> Nicolás Alvarez
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140628/27b42721/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list