Skip to content

Instantly share code, notes, and snippets.

@afabri
Created April 19, 2018 17:17
Show Gist options
  • Save afabri/1f47f0c36bd649088495e9b82a45acde to your computer and use it in GitHub Desktop.
Save afabri/1f47f0c36bd649088495e9b82a45acde to your computer and use it in GitHub Desktop.
// $ cl.exe -I c:/3rdPartyLibs/boost/boost_1_67_0 /EHsc -permissive- nonpermissive.cpp
// Microsoft (R) C/C++ Optimizing Compiler Version 19.13.26131.1 for x64
// Copyright (C) Microsoft Corporation. All rights reserved.
//
// nonpermissive.cpp
// nonpermissive.cpp(35): error C2760: syntax error: unexpected token 'constant', expected 'declaration'
// nonpermissive.cpp(35): note: This diagnostic occurred in the compiler generated function 'void X<T>::fct(void)'
// nonpermissive.cpp(38): note: see reference to class template instantiation 'X<T>' being compiled
#include <boost/variant/variant.hpp>
template <typename T>
struct P {
P()
: first(0), sec(0)
{}
T first, sec;
};
P<int> makeP() { P<int> p; return p; }
template<class T>
struct X {
template <class T2>
void
fct()
{
P<int> r = makeP();
bool b = r.first < 2 && r.sec > 3 ; // line 35
}
};
int main()
{}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment